Can images be added together?

Monkey Forums/Monkey Programming/Can images be added together?

Arabia(Posted 2013) [#1]
If I have two images, one is a,60 in size, then other is b,60 in size, can I do:

image1 = image2 + image3

which means image1 is now a a + b (width) * 60 (high) image?

Looking for something to create an image to display the score - because obviously a 1 is smaller width wise than an 8.

Only other options:

print individual images for each number representing the score using Image Width to find the new offset for the next number in the score string.

or

use the font printing capability which I'm led to believe is rather slow and something that should be avoided

What's the best way to go?


Gerry Quinn(Posted 2013) [#2]
You will have to draw them both in the back-buffer and use ReadPixels and WritePixels to make a new image.

Or if the image is too big to fit in the buffer (unlikely in this instance) you could use ReadPixels on both, then make a new array combining the two, then use WritePixels.

Fonts are very slow in HTML5 if they are coloured. On other platforms and if they are pre-coloured, they are a bit sluggish but not terrible. Printing the score won't generally kill your framerate, even in a worst-case scenario.


MikeHart(Posted 2013) [#3]
Use bitmap fonts, means print every image separately. Fastest method definitely.


Arabia(Posted 2013) [#4]
Thank you guys.

I ended up downloading FontMachine that came with JungleIDE and got it working in about 10 mins - don't know why I didn't do this first.