BitmapDataIso with scaled bitmaps

43 views
Skip to first unread message

SPUn

unread,
May 15, 2016, 10:02:21 AM5/15/16
to Nape Physics
Hey,

I'm using BitmapDataIso to create ground, and now trying to make everything responsive to the size of mobile device screen, and having a bit issues with it; if I use matrix.scale to make the ground bitmap larger, IsoBody gives me rectangular body. What would be the right way to get nice ground body after scaling the source bitmapdata?

Thanks,
 Tony

SPUn

unread,
May 16, 2016, 11:19:01 AM5/16/16
to Nape Physics
Ah, scaleShapes does the job as I know the scale factor! Not the solution for my problem, but it removes the problem. :)

SPUn

unread,
May 16, 2016, 12:02:53 PM5/16/16
to Nape Physics
One related question tho: as I am scaling everything to fit all mobile devices, I'm adding ratio multiplier to all nape shapes.

How about masses, impulses and gravity? If I add the same multiplier to all those, the game feeling doesn't feel quite the same (when comparing original to 2x size screen).
It feels pretty identical if I use this multiplier to gravity and impulses, and keep static values for masses. But don't I have relatively wrong masses then?

My current demo is kinda simple so I might not see the whole picture here. I have sidescroller vehicle that shoots rockets (bodies with impulse) and in my test I observe the physics of these rockets.

T1m_

unread,
Jun 10, 2016, 6:28:21 AM6/10/16
to Nape Physics
Why not scale GRAPHICS instead of physics object?

SPUn

unread,
Jul 4, 2016, 3:56:49 AM7/4/16
to Nape Physics
Hmm never thought that, damn. It would indeed be simple to use scale factor when positioning graphics in updateGraphics. Thanks, I'll see how it goes. o/
Reply all
Reply to author
Forward
0 new messages