Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
box2d body and gtween — Gideros Forum

box2d body and gtween

since box2d body doesn't inherit from Sprite class, it can not be used with gtween directly
so i had to use dummy sprite to move my box2 body like so:
	self.dummyboxLT = Sprite.new()
	self.dummyboxLT:setY(self.boxLT:getY())
	local f = function()
		self.boxLT.body:setPosition(self.boxLT:getX(),self.dummyboxLT:getY())
	end
 
	self.gtw = GTween.new(self.dummyboxLT, 0.5, {y=self.dummyboxLT:getY() +self.wallspacing}, {delay = 0, ease=easing.outBounce, onChange = f })
if there is a simpler solution to this , please share it

Comments

Sign In or Register to comment.