User Tag List

Results 1 to 10 of 10

Thread: Width or Virtual Width for the window size?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Simflare's Avatar
    Join Date
    Oct 2013
    Location
    Australia
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Width or Virtual Width for the window size?

    I am trying to devise a theory for working out which device the game is running on for iOS. The theory also requires working with the 'fit outside' setting for iOS.

    Basically, my game is a puzzle game and each level has a fixed size. I figure it would work best for me to cut the edge off and just move the camera for each device. But where I want to move my camera will depend on which device is being used, ie, how wide the screen is. So on iPhone 4 I would want it to return a width value of 960, and on iPad 1136.

    Now, when I go to get this property, I go to the "Storyboard Controls > Frame" and then I'm not sure if I should choose "width" or "virtual width"? Which one will give me the size of the window, not the size of the frame?

    Or otherwise, will I have to use the "X coordinate of left / right visible edge" and subtract them from each other? I was hoping the window size was already stored somewhere though.

    Unless there is a better way to get the width of the window?

    Thanks
    Simflare

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,307
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    I always do the edge subtraction to get the window size. I don't think there is a direct expression for it. But you could also just do that subtraction once, store its result in a global variable and then reference the variable.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Simflare's Avatar
    Join Date
    Oct 2013
    Location
    Australia
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool yeah I was thinking that might work, I guess that's fairly straight forward. Storing it in a variable is a good idea.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Simflare's Avatar
    Join Date
    Oct 2013
    Location
    Australia
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This doesn't quite seem to work.
    I tried : (X coordinate of left visible edge) - (X coordinate of right visible edge) in a blank frame before anything else with a Start of Frame event.

    But when I tested it on iPhone 5 emulator, and when testing on my iPhone5, it returned a value of 958. It should be 1136. When I test on iPad 2, I get 720 instead of 1024. So this doesn't seem to work.
    I am using the 'Fit outside' option for screen size. I would have expected this to work... I can't think of anything I could be doing that would be stuffing it up.

    Any other idea's about how to get the window size? Or idea's about where I might be going wrong?

  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    'Window Controll Object' - 'Get width/ height of client window'
    Maybe?

    I tried it for a HTML5 build, and it seemed to return the content area of the Browser ( the Browser being the canvas of the App ).
    So im guessing the client in iOS would be the screen size maybe?

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Simflare's Avatar
    Join Date
    Oct 2013
    Location
    Australia
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool idea I"ll try it now

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Simflare's Avatar
    Join Date
    Oct 2013
    Location
    Australia
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Using the Window Control object also gives me 720 width for iPad 2 instead of 1024. In fact it gives 720x540. For iPhone 4 it gives 810x540. There must be something else going on here.

    Could it have something to do with "Fit Outside"? From what I understood, Fit Outside resizes the window, and therefore 'Set Value A to "WinXSize( "Window Control" )" ' should set the value to the new width of the window. But this doesn't seem to be happening.

    All I can think of is that it's measuring the width at the wrong time (I'm using 'Start of Frame' within the level) or it's measuring the wrong area somehow?

    At least it's consistently wrong, the numbers are the same every time, so they're measuring somethings that's consistent, it's not random.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Simflare's Avatar
    Join Date
    Oct 2013
    Location
    Australia
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Interestingly the iPad 2 and iPad Air both return 720x540, even though the iPad Air clearly has a larger resolution. Something funny is going on. Maybe it's not returning the resolution but some other value?

  9. #9
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,307
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    A simple work around would be to get the ratio of width to height. That way you can still determine if it is 4:3 or 16:9.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Simflare's Avatar
    Join Date
    Oct 2013
    Location
    Australia
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's exactly what I was thinking of doing, not sure how to get the ratio though. I figured a simple subtraction might to the trick though. Eg

    Width - height = X

    If X greater than Y, It's 16:9
    If X less than Y, It's 4:3

    Because I figure X will always be greater for wide screen, because the screens are much wider than 4:3, and so therefore that equation should work.

    Something odd to note is that all of the iPhone emulators come up as 720 x 540, so since they're consistent, I can probably use that, even though it wasn't the number I was expecting.

    Unless you know a better equation to properly work out the ratio?

Similar Threads

  1. Bug with virtual frame width?
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 15th June 2010, 01:57 PM
  2. frame size and virtual width/height
    By MelliGeorgiou in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th October 2006, 12:14 PM
  3. Virtual Height and Width, what are they?
    By Durnus in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 16th September 2006, 05:05 PM
  4. Virtual Width/ Virtual Height Revisited
    By Donald in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 16th July 2006, 12:32 AM
  5. Changing Virtual Height and Virtual Width at run
    By Donald in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 13th July 2006, 10:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •