Page 1 of 1

Can I change the theme in RUBE?

Posted: Sat Aug 23, 2014 9:16 pm
by skinwalker
Hello,
I am developing my runner game and I use black elements for my terrain(trees,grass etc) and the scene's theme is black can I change it to white or something else?If not I have to create a very big white image and put it behind my terrain to simulate white theme :D .

And one more question : when I scale down/up my images in rube can I see the final width and height of the image in pixels? It would be super useful for me.

Re: Can I change the theme in RUBE?

Posted: Sun Aug 24, 2014 12:15 am
by iforce2d
Look in the "Colors" tab of the options dialog (under 'Tools' menu). You can change the color of the background, that should help.

Scaling an image does not change the width and height in pixels of the image, it just changes the 'scale' property of that image so that your application knows that it should be drawn larger or smaller. RUBE has no idea about how the output file will be used in your game, and what hardware or screen etc you will run it on, so there is no way to determine what "final" size would mean.

However, I guess you are using a 'pixel to meter' ratio, in which case you could use a script like this:

Code: Select all

float PTM = 50;

image i = si()[0];
float w = i.getPixelWidth();
float h = i.getPixelHeight();
float scale = i.getScale();

float pixelHeight = scale * PTM;
float pixelWidth = (w / h) * pixelHeight;

print( "Pixel dimensions: " + pixelWidth + " x " + pixelHeight );
The thing is though, since the "final" PTM will depend on what screen size the app finds at runtime, you would need to change the PTM in this script to get say, the result for iPad, result for iPhone4, result for 800x480 Android etc. I'm afraid I don't see how it helps much to know this information anyway :)

Re: Can I change the theme in RUBE?

Posted: Sun Aug 24, 2014 10:22 am
by skinwalker
I need to know the width and the height of the image, because I use my character's image in rube to create the body so I scale it up and down to fit the scene, then I remove the image and I have only the body, I create my image with my engine and connect it with that body, the problem is that I don't know the width and the height of the body,so I don't know how much width and height should be my character's image to have a perfect collision.