How do I use OriginalViewportWidth?

0 favourites
  • 3 posts
  • Maybe this is a bug but it is present in every version of C3 and in the last version of C2 so I feel like I just don't understand. It doesn't seem likely that this system expression has just never worked so I don't want to fill out a bug report until I understand what it is supposed to do.

    I have a project that is 720 x 720 at the beginning. If I set a text.text to OriginalViewportWidth it shows 720.

    If I then resize the canvas to say 1080 x 1080, I though OriginalViewportWidth should still show 720, but it shows as 1080. The manual says, "The value of these expressions does not change even if actions like Set canvas size are used."

    (That's the whole code)

    Is there a way to get the original size of the viewport that is set in the project properties of the editor without manually storing it?

    Tested on current Edge and Firefox.

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This sounds like a bug, and will probably be fixed shortly if a proper bug report is made. Or maybe after the holidays anyway.

  • In case anyone finds this post later:

    Ashley says it was the manual that was wrong or incomplete. OriginalViewportWidth was never intended to work for canvas size changes in fullscreen mode.

    "Note however that the system Set canvas size action does modify the values returned by these expressions when in any fullscreen mode other than Off, as in this case it has the effect of changing the Viewport size project property."

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)