User Tag List

Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 33

Thread: Flash Game Scaling Example

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Sep 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Flash Game Scaling Example

    I've been trying to get flash game scaling to work for a few upcoming games on the Daily Click Arcade, and have managed to get it into a working state now (tested under IE8, FireFox, Opera, and Chrome)

    Had a few people say they might also find this useful, so I'm posting an example of this up here should anyone find it useful.


    First, a few examples of it in action:

    http://www.create-games.com/sly/zeb_normal.html
    http://www.create-games.com/sly/zeb_x2.html
    http://www.create-games.com/sly/zeb_x3.html
    http://www.create-games.com/sly/zeb_x0.5.html


    It should be relatively easy to use, if you compair the source code of the first document with the three after it, you'll see 8 additional lines of code present.

    These can be copied into your html document, and you should just need to change the game id, and scale value.. you'll find the ID of your game by looking at the original code, look for either an id="" or name="" tag (these should both be the same). This needs inserting into the first parameter (in the example above, this is "zeb").

    The second parameter sets the scale, for example 1 = 100% (no change), 2 = 200% (double size), 0.5 = 50% (half size)

    You'll also have to upload the .js file (included in the zip below) to your server, in the same directory as your html document. This should hopefully be all you need.

    I've tested a number of games, and havn't found any issues with it yet, however there may always be some, so please be aware of this.

    Anyone is welcome to use/adjust/modify/improve on this in anyway you wish, it's just an example, so play around as much as you want.

    This zip contains the .js file, and all of the examples posted above:

    http://www.create-games.com/sly/swfscale.zip

    Edit: And one thing I forgot to mention.. vector based objects (Such as Strings, Text Counters, Buttons), are also resized and scaled correctly.. they're scaled as vectors would be though (Strings, for example, have their font size increased), rather than the pixels being doubled - which makes text much more readable and smooth


    Thanks,
    -Clubsoft

  2. #2
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Flash Game Scaling Example

    Clubsoft, this looks interesting and thanks.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Flash Game Scaling Example

    Thanks for pointing that out - what's especially useful is that the scaled games don't exhibit the scaling problem described here, even when you zoom the page. (Try the scrollwheel on the 2x or 3x pages, compared to the first "normal" one without the Javascript function.)

    It's possibly to do with resizing the width and height of the Flash element directly? I'm not sure.

  4. #4
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Sep 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Flash Game Scaling Example

    By default, setting the width and height of the element directly will just resize the area which is displayed - the scale will stay the same, and you'll end up with hidden/offscreen objects appearing and other strange issues.

    You can set the scale if you first call ".Zoom(0)" with JavaScript to the object (i.e. window.document["zeb"].Zoom(0) ) - which will then adhere to the objects specified size correctly - this is basically what the script does, and will resize the element automatically once it's loaded (I've had issues trying to do this before it's reached 100%)

  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Flash Game Scaling Example

    Thank you!!!

    Now we don't have to worry about cheaters any more!

  6. #6
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Sep 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Flash Game Scaling Example

    It does seem to fix issues with the browser zoom if you set the scale to 1 (so nothing is resized):

    Original: http://www.create-games.com/sly/zeb_normal.html
    Fixed: http://www.create-games.com/sly/zeb_x1.html

  7. #7
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Flash Game Scaling Example

    Clubso[color:#000000]f[/color]t you are my hero.
    Working as fast as I can on Fusion 3

  8. #8
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Flash Game Scaling Example

    Yes I know, I've already tried!

    Hence the excitement!!!

  9. #9
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    UrbanMonk's Avatar
    Join Date
    May 2008
    Location
    Southern U.S.A.
    Posts
    847
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Flash Game Scaling Example

    Clickteam should add this to the exporter.

  10. #10
    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,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: Flash Game Scaling Example

    Thanks so much Clubsoft. I agree it would be nice to have a checkbox in the exporter parameters.

Page 1 of 4 1 2 3 ... LastLast

Similar Threads

  1. YWHTG: You Will Hate This Game [Flash] Skill / Avoidance game
    By FGRaptor in forum Released Games & Apps in Flash
    Replies: 2
    Last Post: 2nd May 2016, 03:14 AM
  2. Getting a flash game sponsored
    By D_Light in forum SWF/Flash Export Module Version 2.0
    Replies: 5
    Last Post: 8th March 2013, 08:32 AM
  3. Top down view game. Scaling ?
    By KLiK-iT in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 30th June 2012, 03:54 PM
  4. Flash Game Screen Size Game Site Preferences
    By Rolando in forum SWF/Flash Export Module Version 2.0
    Replies: 1
    Last Post: 4th January 2012, 04:04 PM

Posting Permissions

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