It is not 3d rotation. For example i have a man on stage whose face looks to x+ , but i want him to look x-. Sorry for bad english:D hope you understand me
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Here's an example of a little game I built in Gideros to help with my daughter's reading. It uses tweening of setScaleX() amongst other things to give a vertical axis flip of an animation. In the game the main character walks left and right based on device tilt. Is this the sort of thing you're looking for?
Here's the pertinent code:
function PrincessMilly:onEnterFrame()local game=PrincessMillyGame.current
if self.walking~=0then
self:walk(self.walking)elselocal ax, ay, az=game.accelerometer:getAcceleration()if ay>PrincessMilly.WALK_HYSTERESIS then
self:walk(-PrincessMilly.WALK_SPEED)endif ay<-PrincessMilly.WALK_HYSTERESIS then
self:walk(PrincessMilly.WALK_SPEED)endend
game.camera:lookAt(self)endlocalfunction sign(x)return(x<0and -1)or1endfunction PrincessMilly:walk(speed)local x=self:getX()+speed
self:setX(x)local angle=math.sin(x/PrincessMilly.JOSTLE_SPEED)*PrincessMilly.JOSTLE_AMOUNT
self:setRotation(angle)if sign(speed)~=sign(self.lastWalk)then
GTween.new(self, 0.5, {scaleX=sign(speed)})end
self.lastWalk=speed
endfunction PrincessMilly:walkLeft()
self.walking=-PrincessMilly.WALK_SPEED
endfunction PrincessMilly:walkRight()
self.walking=PrincessMilly.WALK_SPEED
end
@bowerandy nice little game, I bet your daughter loved it.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Comments
Fragmenter - animated loop machine and IKONOMIKON - the memory game
https://deluxepixel.com
if I understand your question
try this way:
Sprite:setScaleX(-1)
sprite is flipped on x.
open "Texture Pack" Gideros example
on file animatedsprite.lua
in function AnimatedSprite:init()
add
self:setScaleX(-1)
self:setPosition(100,100)
it works on movieclips also.
hope it helps.
Likes: SinisterSoft, omer
www.tntengine.com
Here's an example of a little game I built in Gideros to help with my daughter's reading. It uses tweening of setScaleX() amongst other things to give a vertical axis flip of an animation. In the game the main character walks left and right based on device tilt. Is this the sort of thing you're looking for?
Here's the pertinent code:
best regards
Likes: SinisterSoft, omer
https://deluxepixel.com