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:-)
Comments
https://deluxepixel.com
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.
:-)
I've added Bitmap:getTexture() and Bitmap:getTextureRegion() :-)
They are stored in instance.__texture and instance.__textureregion.
What happens if you change the size of a child?
Your other additions look great too.
https://deluxepixel.com
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
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.
https://deluxepixel.com
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
https://drive.google.com/open?id=0B8mnhWOnho8ndHdjRlllMERrSzQ&authuser=1
Likes: SinisterSoft
btw, Did you push your emulator updates to the github source?
https://deluxepixel.com
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.
:-(
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.
Likes: SinisterSoft, ar2rsawseen