User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: scaling active objects, with Mode 7 Ex

  1. #1
    Clicker Fusion 2.5iOS Export ModuleXNA Export Module

    Join Date
    Oct 2009
    Location
    Jacksonville, TX
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    scaling active objects, with Mode 7 Ex

    Hello,

    I am having an issue with getting active objects that are sprite-mapped to a Mode 7 surface to scale smoothly... I used "get on-screen width/height from X,Y,W,H" to get them to scale ok, but the scaling is really rough and doesn't look right. I am looking into using 3D Actives to move and scale the active objects around, but so far haven't been able to get the positions of the objects being moved by 3D Actives to stick to their sprite-mapped locations on the Mode 7 field. Does anyone have a tip on how to handle the weird scaling, or how to get 3D Actives to move an object around relative to the Mode 7 origin? Thanks!


    -Joel

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: scaling active objects, with Mode 7 Ex

    Are you using smooth or fast scaling? (0 or 1 in the action)

  3. #3
    Clicker Fusion 2.5iOS Export ModuleXNA Export Module

    Join Date
    Oct 2009
    Location
    Jacksonville, TX
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: scaling active objects, with Mode 7 Ex

    I am using "1" for higher-quality scaling, but honestly I don't really see any noticeable difference between the two modes. The sprite is scaling in giant leaps, so if I start as far away as possible (where I can still see the sprite) then move forward it will only change scale maybe 3 or 4 times before I run over it. I believe I have gotten some better results using an Active Picture Object, but for my game I need the sprites to animate... Thanks for the help Dynasoft!

  4. #4
    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: scaling active objects, with Mode 7 Ex

    Can we see the formula you use for scaling in [code][/code] tags?
    Working as fast as I can on Fusion 3

  5. #5
    Clicker Fusion 2.5iOS Export ModuleXNA Export Module

    Join Date
    Oct 2009
    Location
    Jacksonville, TX
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: scaling active objects, with Mode 7 Ex

    Sorry, I don't really know what that means! Here are the events I am using for the sprite mapping, I hope this is what you were asking for.


    Start of Frame - >
    Torch : Set W to XScale("Torch")
    Torch : Set H to YScale("Torch")

    Always - >
    Torch : Set X_MAP to GetMapXZ("Mode7Ex", X("TorchMARKER"), Y("TorchMARKER"), ZPOS("TorchMARKER"))
    Torch : Set Y_MAP to GetMapYZ("Mode7Ex", X("TorchMARKER"), Y("TorchMARKER"), ZPOS("TorchMARKER"))
    Torch : Set W_MAP to GetMapWidth("Mode7Ex", X("TorchMARKER"), Y("TorchMARKER"), W("Torch"), H("Torch"))*0.2
    Torch : Set W_MAP to GetMapWidth("Mode7Ex", X("TorchMARKER"), Y("TorchMARKER"), W("Torch"), H("Torch"))*0.2
    Torch : Set VISIBLE to GetMapVisible("Mode7Ex", X("TorchMARKER"), Y("TorchMARKER"), W("Torch"), H("Torch"))

    VISIBLE of Torch = 0
    Torch: Make invisible

    VISIBLE of Torch = 1
    Torch: Reappear
    Torch: Set X position to X_MAP("Torch")
    Torch: Set Y position to Y_MAP("Torch")
    Torch: Set X scale to W_MAP("Torch") (Quality=1)
    Torch: Set Y scale to H_MAP("Torch") (Quality=1)


    It occurred to me while looking around the forums that maybe the scaling calculation is using an integer where it should be getting a floating point value. I tried changing it around a bunch of different ways, but I still didn't see any visible difference in the sprite mapping. With 3D Actives the sprites scale so beautifully... I really hope I can achieve a similar result with Mode7Ex.



  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: scaling active objects, with Mode 7 Ex

    Well, the problem is that you're passing the width/height in pixels to the scale. You have to divide them by the original size, e.g.

    Torch : Set W to XScale("Torch")/32.0
    Torch : Set H to YScale("Torch")/32.0

  7. #7
    Clicker Fusion 2.5iOS Export ModuleXNA Export Module

    Join Date
    Oct 2009
    Location
    Jacksonville, TX
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: scaling active objects, with Mode 7 Ex

    Thanks Looki,

    Could you please elaborate a bit on your suggestion? Dividing the XScale and YScale of the sprite by its original dimensions returns "1.0", yes? Would this not make the game think the sprite is only 1 pixel wide/high? The image I am trying to sprite map is 128 x 256; I tried dividing by those dimensions, but my sprites just disappeared! Could you explain specifically how dividing by the image dimension should affect the calculation? Thanks again for the help!


  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: scaling active objects, with Mode 7 Ex

    Ahh, sorry for that. You have to multiply them to get the width/height.
    You have to divide the width by the original width to get the X scale. :blush:

  9. #9
    Clicker Fusion 2.5iOS Export ModuleXNA Export Module

    Join Date
    Oct 2009
    Location
    Jacksonville, TX
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: scaling active objects, with Mode 7 Ex

    All right, after some messing around I was able to get it to work. Thanks a million Looki!

  10. #10
    Clicker Fusion 2.5iOS Export ModuleXNA Export Module

    Join Date
    Oct 2009
    Location
    Jacksonville, TX
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: scaling active objects, with Mode 7 Ex

    I have one follow up question, if I may... the sprites are scaling nicely now, but there is a pretty bad lag and intermittent crash of the runtime when the sprite is directly behind the camera. Here is what the sprite-mapping events look like now:

    Start of Frame - >
    Torch : Set W to XScale("Torch")*128
    Torch : Set H to YScale("Torch")*256

    Always - >
    Torch : Set X_MAP to GetMapXZ("Mode7Ex", X("TorchMARKER"), Y("TorchMARKER"), ZPOS("TorchMARKER"))
    Torch : Set Y_MAP to GetMapYZ("Mode7Ex", X("TorchMARKER"), Y("TorchMARKER"), ZPOS("TorchMARKER"))
    Torch : Set W_MAP to GetMapWidth("Mode7Ex", X("TorchMARKER"), Y("TorchMARKER"), W("Torch"), H("Torch"))*0.2
    Torch : Set W_MAP to GetMapWidth("Mode7Ex", X("TorchMARKER"), Y("TorchMARKER"), W("Torch"), H("Torch"))*0.2
    Torch : Set VISIBLE to GetMapVisible("Mode7Ex", X("TorchMARKER"), Y("TorchMARKER"), W("Torch"), H("Torch"))

    VISIBLE of Torch = 0
    Torch: Make invisible

    VISIBLE of Torch = 1
    Torch: Reappear
    Torch: Set X position to X_MAP("Torch")
    Torch: Set Y position to Y_MAP("Torch")
    Torch: Set X scale to W_MAP("Torch")/128 (Quality=0)
    Torch: Set Y scale to H_MAP("Torch")/256 (Quality=0)


    Maybe there is a problem with the GetMapVisible calculation? It seems to be hiding + showing the sprite properly... any help I could get would be appreciated. Thanks!

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Active Object Scaling
    By Ninjadoodle in forum Android Export Module Version 2.0
    Replies: 1
    Last Post: 5th May 2013, 02:40 AM
  2. Active scaling a little off?
    By AyreGuitar in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 17th April 2012, 03:18 PM
  3. Nearest neighbour scaling in window mode
    By Grillchips in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 4th February 2010, 12:30 PM
  4. Scaling/Dragging Active objects
    By Joeyotrevor in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 20th January 2009, 10:16 PM
  5. Smooth Scaling of Active Objects?
    By Renatos in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 13th March 2008, 05:48 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
  •