Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

How to flip the sprite while using draw_sprite_3d

A topic by Zhanghua created Jan 08, 2022 Views: 153 Replies: 2
Viewing posts 1 to 3
(+1)

When I draw a billboard sprite, and pass the xsacle to -1 for draw_sprite_3d, the result distorted.

How can I get this effect normal?

(+1)

Got that, I should calculate the Angle between the player's direction with camera


var cdir = abs(Camera.Angle) % 360;

if ( Camera.Angle < 0 ){ cdir = 360-cdir; }

var dAng = cdir+direction-90;

if ( dAng <0 ){ dAng += 360; }

if ( dAng >=360 ){ dAng -= 360; }

if( moving ){

if( dAng>100 && dAng<260 ){ sprite_index = sprGroup[$ "moveL"]; }

if( dAng>280 || dAng<80  ){ sprite_index = sprGroup[$ "moveR"]; }

}

(+1)

hey! Glad you got it working!! Interesting about the scaling though, I will look into that for sure!

moved this topic to Questions