Resizing an overlay

I seem to recall that one cannot resize an overlay, but I’m looking at the way the icon is resized according to the screen resolution in the Journal module and wondering if I’m misremembering.

function Journal:resize() -- Icon size = (config.displayWidth * self.ICON_MAX_SIZE) / 1920 if size > self.ICON_MAX_SIZE then size = self.ICON_MAX_SIZE elseif size < self.ICON_MIN_SIZE then size = self.ICON_MIN_SIZE end --etc.
I have a lot of overlays and if someone plays them on a smallish screen, the images will exceed the size of the screen. So, can an overlay be resized? And if it can, do all of the buttons and other images on it resize automatically with it?

No, they can’t be resized, only moved. What you can do is resize buttons individually according to the screen resolution :nod:

Maybe the background could be a totally transparent image and the “real” background image be a button without interaction? Buttons on top of another button…? Hmm… some of these overlays are almost fullscreen.

In fact, overlays aren’t supposed to have backgrounds, and yes, you can overlap buttons in way you wish. Just keep in mind the order in which they’re drawn :slight_smile:

Sorry to be imprecise. I meant the background button like your journal’s notebook image.

So the alternatives are to layer the buttons and resize (and position?) each of them as you did the journal’s icon or to not make any overlay or combination of overlays be larger than say 1024 x 768. I think that can work. RF2 is really doing this, but I’m “helping.” :stuck_out_tongue:

Hhmmm… I suggest you stick with the buttons for now. The overlay system needs an overhaul. As soon as we improve them, you could easily migrate the code for a cleaner result :nod:

Remember you CAN move the overlays to match your current resolution though (ie: having them “glue” to a corner of the screen). Resizing buttons isn’t a “must”.

Yes, we do have them set so that they have a 30 pixel offset from each corner and that works fine. Thanks.

P.S. - Try not to let Kickstarter drive you to drink. :stuck_out_tongue:

Too late.