Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
application:setScaleMode options in reference manual don't exist? — Gideros Forum

application:setScaleMode options in reference manual don't exist?

jtlyjtly Member
edited March 2014 in Bugs and issues
The values that can be passed to be application:setScaleMode such as Application.NO_SCALE, Application.CENTER... that are listed in the reference manual don't seem to be defined at runtime. Calling application:setScaleMode(application.NO_SCALE) fails with a type error. Calling print(application.NO_SCALE) gives nil. application:setScaleMode works if you use the string equivalent "noScale" instead.

Not sure if this an error in the documentation or in the code but the two are not consistent.

Also in the reference manual the application object is capitalized (Application) but in the code you need to use the lowercase version (application).

Very confusing for new users like myself.

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    Hello @jtly let me try to clarify

    So
    Application
    is a class, while
    application
    is an automatically created instance of the
    Application
    class and stored in variable named
    application
    .

    Basically somewhere in the init code we have something like that:
    application = Application.new()
    which creates global variable application for your use

    Now there are instance methods and static methods. Instance methods need an instance to be used and they are written using colon ":"

    So you can do this:
    print(application:getFps())
    But you can't do this:
    print(Application:getFps())
    But accessing static properties using dot "." can be done through both class and instance, so both would work
    print(Application.PORTRAIT)
    print(application.PORTRAIT)
    Now about those specific values, yes it seems it is a bug. If you see there are no properties like that in the list (which is generated automatically from the code), only mention of them is at
    Application:setScaleMode
    method.

    I will add it as a bug and will be fixed in next version, for now, you can use plain values as "noScale", "center", etc to change scale mode ;)

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • I was just about to post this reply! :)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • jtlyjtly Member
    Thanks for the clarification on Application vs. application. Totally makes sense.

    I just started with Gideros yesterday and I'm liking it a lot so far - especially the ability to so quickly and easily push code to the mobile device over wifi. That is a huge productivity boost.
Sign In or Register to comment.