User Tag List

Results 1 to 5 of 5

Thread: What correct expression Image's center Xpos/Ypos

  1. #1
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)
    BackStaged's Avatar
    Join Date
    Aug 2010
    Location
    France
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What correct expression Image's center Xpos/Ypos

    So, ok, i try to find a way to "find an expression which can allow me to find this":

    - Find Center of an Image Box in a Frame
    (even if i move the App window)

    - Find Center of a Frame
    (even if i move the App window, trying some VirtualWidth/Height.. but not work :/)

    I trying some and some ways to figure this.. but, always fails..

    Can you help me please guys?

  2. #2
    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: What correct expression Image's center Xpos/Ypos

    (X Right - X Left)/2
    OR
    (Y Bottom - Y Top)/2
    OR
    (Width/2)+Offset
    OR
    (Height/2)+Offset


    Do any of these help or did I misunderstand?
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)
    BackStaged's Avatar
    Join Date
    Aug 2010
    Location
    France
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What correct expression Image's center Xpos/Ypos

    Hello LB, thanks for answer, but:

    some of yours expressions give to me an "Error". Expression Incorrect or same thing of that..



    So, then, let me better explain LB (so as this i hope you understand me).

    For learning how Mouse Object work, i have created an application.

    In this application:

    - 2 Labels refresh ALWAYS.
    Code:
        (1 indicate Mouse X Position)
        (1 indicate Mouse Y Position)
    => This work!

    - 2 images
    - 2 buttons (each under one image)

    =>

    - I want set my Cursor Position (X/Y) in the center of my first Image, even if i move the App Window..

    => This, not work.

    Because:

    I have no idea for catching the Center of the App Window. (true app window)..

    I have no idea for catching the real main X Point/Y Point for test the positions of my Image object/of my Frame (also App Window).

    It's give me weird result.
    And it's curiously inneficace.

    Then i'm stuck, in HTML for centering a POPUP with Javascript, it's in this syntax:

    for "top" parameter:
    HTML Code:
    Math.floor( (screen.width - widthv) / 2);
    for "left" parameter:
    HTML Code:
    Math.floor( (screen.height - heightv) / 2);
    Where widthv and heightv are given by User (or Developer).

    (because in HTML, the Popup parameter (window.open()) need this parameters: top, left, height, width)

    But, in MMF2, theses parameters seems unfoundable..
    (meaning: Return the ScreenWidth or ScreenHeight. It's only applicable on Frame, not on Screen...)
    or i miss them???.. so..


    Actually the problem is: Ignoring the App Window Position (so, then, the Frame Position distance with Real Screen Position).


    Thanks for your future help (and for actual help).

  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: What correct expression Image's center Xpos/Ypos

    Those expressions were meant to have the keywords replaced by the actual expressions.

    There is the Window Control Object. It's one of the objects that comes with MMF2 when you installed MMF2.

    Anyway, one of the examples for the mouse object shows how to set the mouse position to an object. You can use the same math for centering it.
    Working as fast as I can on Fusion 3

  5. #5
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)
    BackStaged's Avatar
    Join Date
    Aug 2010
    Location
    France
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: What correct expression Image's center Xpos/Ypos

    Thanks for the Window Control object '(it called Contrôle Fenêtre in French)'. It seem fit what i was searching for!

Similar Threads

  1. Oddity: xPos array on drawing text is set to 100
    By DavidN in forum XNA Export Module Version 2.0
    Replies: 2
    Last Post: 5th September 2013, 09:01 PM
  2. Load an image via an expression
    By Solgryn in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 12th February 2012, 06:42 AM
  3. Always set xpos to a relative value
    By ac3raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 8th August 2011, 02:55 AM
  4. Strange changes in YPos of Text Blitter
    By JoKa in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 8th July 2008, 08:59 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
  •