User Tag List

Results 1 to 7 of 7

Thread: How to resize an active to exact pixel dimensions?

  1. #1
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Darkhog's Avatar
    Join Date
    Jan 2009
    Location
    /dev/null
    Posts
    417
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    How to resize an active to exact pixel dimensions?

    I know there's scale thing, but it's more of a multiplier of width/height of an object. I want to affect width/height precisely in runtime. So e.g. I have 20x30 active and I want to resize it to be exactly 234x967. How do I do that?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    You can set:

    X scale to 234.0 / 20 (or directly 11.7)
    Y scale to 967.0 / 30 (or directly 32.24)

    make sure you use floating point values because scales need a float to give the precision you need

    If you are going to resize the object multiple times, you have to take note of the object starting dimensions
    (i.e. you can save them in some alt. value at start of frame) and use these values instead of 20/30 to perform the calculation above

  3. #3
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Darkhog's Avatar
    Join Date
    Jan 2009
    Location
    /dev/null
    Posts
    417
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Thank you. Wish there was a way to just set it directly at runtime, similar how you can set the position though. But this will do. Thanks again.

  4. #4
    Clicker Fusion 2.5 Developer
    PBarwick's Avatar
    Join Date
    Jul 2014
    Posts
    390
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You can also refer to the width of the active dynamically if that is useful:

    X scale to 234.0 / OWidth("Active 1")
    Y scale to 967.0 / OHeight("Active 1")

    Or use qualifiers to make it refer to many actives, etc

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Hey PBarwick
    it's been a while, cool to see you around!

    Well said, I actually meant to write exactly that, but for some odd reason I ended up writing full figures,
    and due to this my second sentence doesn't make much sense.

    Now it should make sense: if you use OWidth and OHeight and want to resize the object multiple times,
    you have to take note of the object starting dimensions (i.e. you can save them in some alt. value at start of frame)
    and use these values instead of OWidth/OHeight to perform the calculation above
    (otherwise the same expression for following scalings won't hold true,
    since scale always refer to the graphic starting size while OWidth/OHeight refer to the object current size)

    Also worth mentioning that Active Picture has that handy function: "set size",
    where you can directly specify width and height, along with other cool features (dynamic hot spots!)
    but of course missing all the animation features Active Object has.

    oh well...
    sorry for the confusion

  6. #6
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    622
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Adding to what PBarwich said, OWidth changes depending on scale and rotation (lets say its a rectangle covering the entire object).

    So if you scale an object more than twice this will happen (e.g. if object width is 32 at 1 scale):

    Set X scale to 100.0 / OWidth ----> 3.125
    OWidth changed to 100
    Set X scale to 100.0 / OWidth ----> 1
    OWidth changed to 32
    ... and so on, the object will flicker between scales.

    Therefore, to easily get rid of this issue without using additional alterable values, you can set scale to 1 and then your scale method:
    Set X scale to 1
    OWidth changed to 32
    Set X scale to 100.0 / Owidth ----> 3.125
    OWidth changed to 100
    ... and so on, although, having twice as many scale actions is obviously a drawback.
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/7RNXFrC
    Dungeon Raiders! - Link soon™

  7. #7
    Clicker Fusion 2.5 Developer
    PBarwick's Avatar
    Join Date
    Jul 2014
    Posts
    390
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thanks @schrodinger good to see you're still active

    P3D looks like it's come a huge way since then!

Similar Threads

  1. Rotating Active objects with odd pixel dimensions
    By soilmaster in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 29th March 2017, 01:08 AM
  2. resize an active object
    By aenever in forum Fusion 2.5
    Replies: 2
    Last Post: 6th September 2014, 01:30 AM
  3. Very Nice "new" Pixel-Resize-Algorithm!
    By Jahkri in forum Extension Development
    Replies: 23
    Last Post: 24th December 2012, 12:54 PM
  4. How to resize an active
    By alspal in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 24th May 2010, 07:58 AM
  5. Active Resize
    By wizkidweb in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 9th October 2008, 03:30 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
  •