Im using chipmunk and spacemanager. I was wondering how you change the the window containment size? I have a tile map and want the containment size to be the same as the tilemap. I know how to get the tilemap size but not sure how to manipulate the containment size. Any suggestions?
How do you change the window size with SpaceManager?
(5 posts) (3 voices)-
Posted 1 year ago #
-
Well if its just a matter of "padding" you can specify horiz. and vert. padding with the inset parameter. If its a question of width and height you can use this alternate function:
-(void) addWindowContainmentWithFriction:(cpFloat)friction elasticity:(cpFloat)elasticity size:(CGSize)wins inset:(cpVect)inset radius:(cpFloat)radiusSadly this still assumes you're starting at point 0,0 I'm thinking that maybe there should be another method now that takes a CGRect so you can actually specify the containment rect directly..... hmmm hope that helps.
Posted 1 year ago # -
Hello.
Did you ever figure out how to make this space larger? Did the rect method work out? I need a space 1920 pixels wide by 640 high, offset by 960 pixels so we start in the centre of the space.
Posted 1 year ago # -
I saw your other post and tried to answer there, not sure what you mean by "start in the centre of the space" you don't mean the origin (aka the bottom-left) of the containment rect do you?... I don't think you do, in which case you're fine using that method above.
Posted 1 year ago # -
Hi. Yes, that method worked fine. Turned out a lot of the problems I've been having were solved by the creation of a new, clean project. :)
Posted 1 year ago #
Reply
You must log in to post.