Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Gideros Source Code Studies — Gideros Forum

Gideros Source Code Studies

marcelojuniormarcelojunior Member
edited December 2014 in General questions
This is a discussion on new features for the Gideros, based on studies in the source code.

There's my last study result:

-- accept pixel values, like a "setScale shortcut"
Bitmap:setSize(int width, int height)

https://drive.google.com/open?id=0B8mnhWOnho8ndWNxUEtWUTR3S28&authuser=1

:-)
+1 -1 (+1 / -0 )Share on Facebook

Comments

  • Nice addition, how amount children of this bitmap? What happens to them? Does their size change too?
    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
  • @SinisterSoft
    I had not tested it, I had done now. I dont know if it is right but, this works like this:

    - The children get the size parameters of parent;
    Parent (100x100), children (100x100). If I setSize(200x200) in parent, the children gets 200x200 too.
    - the children get the size relative to parent;
    Parent (100x100), children (100x100). SetSize(50x50) in parent, children get 50x50 too, setSize(50x50) in children, his gets smaller (like 25x25).

    You could understand? I make this functionality only for test and study, I can change it to make compatible with other logical.

    :-)
  • Oh, It's not as difficult as I thought.
    I've added Bitmap:getTexture() and Bitmap:getTextureRegion() :-)

    They are stored in instance.__texture and instance.__textureregion.

    :D
  • @marcelojunior , that is how I would have expected it should work...

    What happens if you change the size of a child?

    Your other additions look great too. :)
    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
  • Well, I have prepared another video to show how some things is working.

    https://drive.google.com/open?id=0B8mnhWOnho8nRldUZ3JOM01sUmM&authuser=1

    For now, I've implemented some functions that appeared in the video:

    ___
    Bitmap:setSize(int width, int height) -- pixel based
    Bitmap:getSize() -- return int width, int height, pixel based

    Bitmap:setWidth(int width) -- pixel based
    Bitmap:getWidth() -- return int width, pixel based

    Bitmap:setHeight(int height) -- pixel based
    Bitmap:getHeight() -- return int height, pixel based

    -- these functions are shortcuts to "scale" factor, all of these affect the result of "setScale", and "setScale" affect the result of these

    ___
    -- example
    bitmap:setScale(2, 0.5) -- in a 100 x 100 image
    bitmap:getSize() -- return 200 x 50
    ___

    Bitmap:getTexture() -- return Texture or nil
    Bitmap:getTextureRegion() -- return TextureRegion or nil

    Application:setWindowSize(int width, int height) -- pixel based
  • SinisterSoftSinisterSoft Maintainer
    edited December 2014
    The video looks great, but one thing isn't clear...

    Are the pixels sizes related to the application scaling system (it is not too low level)?

    So if you have a project with the screen size set to 320x480 set the mode to stretch. Add a 160x240 pixel sized image (set using setSize(160,240) ) to the top left ( setPosition(0,0) ) and it should display taking up the full top left quarter of the screen - no matter what the real pixel resolution is.

    I'm guessing this is what you have added (you don't ignore the overall application scaling setting).

    But I think there needs to also be a set of commands to set/get the real data.

    eg: setRealWidth(w), getRealHeight(h), setRealSize(w,h), getRealSize(), setRealX(x), setRealY(y), getRealX(), getRealY(), setRealPosition(x,y), getRealPosition(x,y)

    These should get/set the pixel data that is physically displayed on the device ignoring the application scaling.

    eg: if you use a letter box scaling then you might have a border at the top of the screen. The logical size is still 320x480 but blank border might be 20 pixels. Setting the y of an object to zero will set it to the top of the bordered area, but setting the 'real' y to zero will set it to the top of the screen.
    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
  • Hi @SinisterSoft

    The functions (setSize, setWidth....) are only shortcuts to modify scale of the bitmap. Because this, they have the same operation, size based on logical and not hardware resolution!

    It's a nice idea to implement setRealSize, I will see how to implement this.

    :-)

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • :)

    btw, Did you push your emulator updates to the github source?
    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
  • No :/

    Here's my repo, when I push all of my work: https://github.com/liberton/gideros

    But, I don't pushed to main gideros repo, because these features are not yet available for the devices, and require additional testing.

    I believe that for a few days, I will not have much time to work on Gideros. I would love to become that a serious work >_< but, unfortunately, it's just something I like to do.
    :-(
  • Hi all!

    I've made a simples "desktop version" test. There's a Qt template that, on open, run the project (and all lua files) of an folder!

    Soon will post news about it.
    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.