toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
when dragging a object with finger, how i make it to be inside the scene only?
guilleface
Member
Posts:
1,014
November 2011
edited November -1
in
Working with GS (Mac)
i try to put some walls around but actor won't collide when i drag it with the finger.
Comments
JohnPapiomitis
Member
Posts:
6,256
November 2011
constrain attribute self.position.x to: max((0+( self.Size.Height /2)),min((480-( self.Size.Width /2)), game.Mouse.Position.X ))
constrain attribute self.position.y to: max((0+( self.Size.Height /2)),min((320-( self.Size.Height /2)), game.Mouse.Position.Y ))
guilleface
Member
Posts:
1,014
November 2011
thanks, thats a long formula lol, my playing area is in x=160 and y=360 counting a big actor 320 width x 480 tall, so i think i should replace those numbers that you put on the formula right? but didnt work.
Sign In
or
Register
to comment.
Comments
constrain attribute self.position.y to: max((0+( self.Size.Height /2)),min((320-( self.Size.Height /2)), game.Mouse.Position.Y ))