wawe, (edited )
@wawe@mastodon.gamedev.place avatar

Edit: This is solved now!

I asked this in Godot Forums and got no answer so maybe someone in the fediverse knows. I am using node2D.DrawTextureRectRegion to draw my sprites. Currently all my textures are drawn using the same Node2D which is why I cannot flip the sprite by flipping the node. DrawTextureRectRegion has support for “transpose” but this only swaps the x and Y axis. Is there way to flip textures when using DrawTextureRectRegion without flipping the node?

theandi0815,
@theandi0815@rollenspiel.social avatar

@wawe can you share a screen grab with your node tree and indicate which node contains the texture you want to flip?

wawe,
@wawe@mastodon.gamedev.place avatar

@theandi0815 This got solved, but thanks for help! I only have one node in the node tree called "MainScene".

vfig,
@vfig@mastodon.gamedev.place avatar

@wawe i dont know if this will work, but you could try flipping either the source or dest rect, i.e. give it the top-right corner as position and a negative width.

wawe,
@wawe@mastodon.gamedev.place avatar

@vfig Wow this actually worked! Thank you! I tried scaling the texture but didn't realize to scale the dest rect.

vfig,
@vfig@mastodon.gamedev.place avatar

@wawe hooray!

PsychoSchneewittchen,

@wawe
I don‘t know exactly how you set up your drawing, but the first thing coming to my mind is scalimg the texture with Vector2(-1,1) oder (1,-1) for horizontal/vertical flipping the texture itself.
What version are you using?

wawe,
@wawe@mastodon.gamedev.place avatar

@PsychoSchneewittchen I am using Godot Engine v4.2.stable.mono.

Let me try to explain my drawing system. So I have a list of objects that I want to draw. These object contain information for drawing such as position, part of the texture draw (Texture is sprite sheet I want to draw for eg. second frame) and the texture.

I loop this list and for each of the "object" I call image below. So node2d in this case is same node for each of these.

wawe,
@wawe@mastodon.gamedev.place avatar

@PsychoSchneewittchen So I am pretty much just using Godot as drawing engine and whole game happens under one node. Hopefully this provided more details.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • godot
  • kavyap
  • InstantRegret
  • ethstaker
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • thenastyranch
  • Youngstown
  • GTA5RPClips
  • slotface
  • Durango
  • khanakhh
  • rosin
  • everett
  • anitta
  • vwfavf
  • Leos
  • osvaldo12
  • cisconetworking
  • cubers
  • modclub
  • ngwrru68w68
  • tacticalgear
  • provamag3
  • normalnudes
  • tester
  • megavids
  • JUstTest
  • All magazines