User Tag List

Results 1 to 6 of 6

Thread: Zooming in and out with viewport?

  1. #1
    Clicker

    Fusion 2.5 (Steam)

    Join Date
    Dec 2014
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Zooming in and out with viewport?

    I cant figure it out, I have it set to follow a rectangle (its like a camera), and it kinda works but when the object goes offscreen it vanishes??... hrmm.....

    and also how do I set it to use the whole screen?

    I want to figure this extension out, I know about CS_zoom which is nice but I want to figure this one out, it is confusing me. I set the rect and it kind of works, but then it vanishes and it also doesnt follow frame. I just want to understand hiow this works

  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,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    source region must be within the visible frame area

    check out this example
    (can't recall the thread it was in..):

    zooming_race.mfa

    in short, screen area (window) must be as wide as frame area,
    but if needed you can play with the window control object to restore an apt window size for your application

  3. #3
    Clicker

    Fusion 2.5 (Steam)

    Join Date
    Dec 2014
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why did you add the 140 to the absolute value of the difference of two positions X and then 200 for the difference of the two positions Y before diving the first by 640 and then the second by 480, is it to compensate for the distance being too low or something?

    nice mfa anyway, not sure i understand the math behind the second part where you set the width to equal the full length of the screen multiplied by the zoom ratio alt values you got before.

    so if theyre closer together, the zoomratio becomes bigger? and further apart it becomes wider? or is it the opposite. I think its the opposite right?

    thx again for the nice example I think I can figure it out maybe.

    Sio just for me to remind myself, the viewport object needs to have its OBJECT SIZE blanket the actual play area, which is different than its Width and Height size?

    or, is the viewport object my new screen for viewing gameplay objects? how do I use the mouse for gameplay and use the viewport object if im viewing the objects from a screen? is that possible or no?

  4. #4
    Clicker

    Fusion 2.5 (Steam)

    Join Date
    Dec 2014
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    eww, turns out i need to now figure a way to offset my mouse coordinates now....

    How do people overcome small textures being rendered in Fusion windows? mine come out tiny but I want them tiny, but then it seems there is poor support for scaling.. (unless you scale with multiples of 2)

  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,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    why did you add the 140 to the absolute value of the difference of two positions X and then 200 for the difference of the two positions Y before diving the first by 640 and then the second by 480, is it to compensate for the distance being too low or something?
    It's because otherwise the source region would have been centeret at raw X,Y positions of cars (>>> their center)
    and so they wouldn't have been completely covered by the camera (running out of screen)

    not sure i understand the math behind the second part where you set the width to equal the full length of the screen multiplied by the zoom ratio alt values you got before.
    This is because if you keep two different ratios, one for X and one for Y, you get a "squeezed" screen, I take both ratios, and choose just one of them,
    in order to mantain a proportional ratio and mantain screen proportions.

    so if theyre closer together, the zoomratio becomes bigger? and further apart it becomes wider? or is it the opposite. I think its the opposite right?
    With the viewport you have two options for zooming:
    1) increase the source region size will "zoom out", decreasing the source region size will "zoom in"
    2) the opposite happens when you resize the "viewport" size itself
    But first one is generally more convenient, as you can keep your viewport size fixed.

    Sio just for me to remind myself, the viewport object needs to have its OBJECT SIZE blanket the actual play area, which is different than its Width and Height size?
    or, is the viewport object my new screen for viewing gameplay objects? how do I use the mouse for gameplay and use the viewport object if im viewing the objects from a screen? is that possible or no?
    Short handbook :
    The object size of the viewport must be the same size you want your application window to be (it's basically a "screen", represents what you "see" in the monitor)
    the source region is what you wanto to "project" in this screen.
    The window size of the application must be at least as wide as the frame size you want to cover, because the viewport can't access pixels outside the window area.
    To fix this, you can use the window control object, and restore whatever window size you need.

    For the mouse, if you need to interact with zoomed objects, this may be an issue.
    I've never tried, but I guess you would need to keep ratios and multiply xmouse,ymouse by these ratios
    (like always setting an object to these tweaked coordinates and interact by this object, rather than raw mouse coords)

  6. #6
    Clicker

    Fusion 2.5 (Steam)

    Join Date
    Dec 2014
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This eems like a huge pain, I thuink ill stick with CS_Zoom effect i got from the complex shaders v2 pack. thanks again form explaining this to me,.

Similar Threads

  1. Replies: 15
    Last Post: 9th May 2015, 07:04 AM
  2. Viewport in 2.5
    By Solgryn in forum Fusion 2.5
    Replies: 8
    Last Post: 18th January 2014, 02:40 PM
  3. Zooming a level with Viewport Object, Lens object, etc?
    By Bipolar_Games in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 9th January 2012, 07:02 PM
  4. Zooming shader? (Layer zooming)
    By The_Alee in forum Hardware Accelerated Runtime
    Replies: 7
    Last Post: 6th November 2009, 03:53 PM
  5. viewport.mfx
    By JoshHarris in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 19th March 2008, 03:54 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
  •