Strike Force Heroes 2
The explosive sequel to the hit game Strike Force Heroes!
3.98 / 5.00 8,795 ViewsObsolescence
Defeat the enormous mechanical beasts--and become one of them.
4.01 / 5.00 43,009 ViewsThe resources on haXe and NME seem fairly limited so I was hoping someone with a bit of experience may be able to help me. I've got my application that I'm working on, and it compiles Android absolutely fine (to my SGS). The window width and height are set in the .nmml file as 800 x 480. I realised that at some point I'd have to begin scaling so it fits all screens on all devices. Right now I'm just using the graphics library from NME to draw a circle that can be interacted with.
How do I scale this?
If I set the window width to 400 x 240 - half of the original - it still looks and works fine on my phone. Surely the game area would be half of what it was before? I feel I'm missing something and any help would be really appreciated :)
Cheers.
I know you asked for people with experience on the matter, and I have not any experience with HaXe, but maybe I could help.
You've probably tried this, but I might as well ask: are there any functions or properties in NME for rendering dimensions that are read/write friendly, instead of read only? Since you're targeting Android, NME should have built-in functions that can get the device's display width and height. If it doesn't... Well, hell...
At 7/18/12 08:36 PM, everette00 wrote: I know you asked for people with experience on the matter, and I have not any experience with HaXe, but maybe I could help.
Frivolous, I know, but I meant to italicize the maybe. Underlining makes me come off as a total dick. maybe I could help :)
At 7/18/12 08:36 PM, everette00 wrote: I know you asked for people with experience on the matter, and I have not any experience with HaXe, but maybe I could help.
You've probably tried this, but I might as well ask: are there any functions or properties in NME for rendering dimensions that are read/write friendly, instead of read only? Since you're targeting Android, NME should have built-in functions that can get the device's display width and height. If it doesn't... Well, hell...
Yeah. In NME it seems like stage.stageWidth and height access the screens height and width. But obviously if I have two phones, one has a screen with double the pixels, I expect my application to double in "size". I have some scaling options: EXACT_FIT, NO_BORDER, NO_SCALE and SHOW_ALL. None give desired results. If I use SHOW_ALL, it almost crops the viewport of the app to the size set in the .nmml file.
At 7/19/12 09:21 AM, Sam wrote:
Yeah. In NME it seems like stage.stageWidth and height access the screens height and width. But obviously if I have two phones, one has a screen with double the pixels, I expect my application to double in "size". I have some scaling options: EXACT_FIT, NO_BORDER, NO_SCALE and SHOW_ALL. None give desired results. If I use SHOW_ALL, it almost crops the viewport of the app to the size set in the .nmml file.
But there aren't any functions or properties that can read hardware information from the device itself?
At 7/19/12 10:38 AM, everette00 wrote: But there aren't any functions or properties that can read hardware information from the device itself?
stage.stageWidth and stage.stageHeight do that. Here's a comparison of two phones with the same application. Basically I can't wrap my head around how to scale to different aspect ratios and how to draw everything at a common denominator and scale everything upwards so it's all relational. Will I have to take into account the variables that grab the screens height and width manually? Because, for example, I have created swipe functionality as NME doesn't support it natively, 200 pixels to swipe (defined in my functions for swiping) on the phone on the right is a decent amount to move and feels nice, as it's 800x480, but the screen on the left is 480x320 so 200 pixels is around half (give or take 80 pixels) of the screen either way.
God damn this is confusing me.
I think I may have a solution for you. Try this. The OP brings up the same question you did, and I think the guy on the end provides him a solution. How well it works, I'm not sure, but you could try that.
Note: The guy at the end has some pretty horrible formatting skills.
His solution, in short, provides a way to scale based off of a resolution you target, and then make changes for when there is a change. I've seen this done in a few XNA examples, where the developer based his resolution off of 1280x720 (mainly for UI purposes), and things were scaled down for lower-resolutions, albeit that XNA does this inherently and he didn't have to life another finger to make it happen. But that is basically what you're trying to do, right?
At 7/19/12 03:35 PM, everette00 wrote: I think I may have a solution for you. Try this. The OP brings up the same question you did, and I think the guy on the end provides him a solution. How well it works, I'm not sure, but you could try that.
Note: The guy at the end has some pretty horrible formatting skills.
His solution, in short, provides a way to scale based off of a resolution you target, and then make changes for when there is a change. I've seen this done in a few XNA examples, where the developer based his resolution off of 1280x720 (mainly for UI purposes), and things were scaled down for lower-resolutions, albeit that XNA does this inherently and he didn't have to life another finger to make it happen. But that is basically what you're trying to do, right?
I did have a look at it before, however, I was wondering if any haXe/NME developers had more insight into it. Either way, thanks for directing me back to it because I've got scaling working really nicely now :)
Cheers for the help man.
At 7/19/12 06:44 PM, Sam wrote:
I did have a look at it before, however, I was wondering if any haXe/NME developers had more insight into it. Either way, thanks for directing me back to it because I've got scaling working really nicely now :)
Cheers for the help man.
Oh, good! I'm glad that I could help you some! Good-luck with the rest of your app!