Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hi and thanks!

Not entirely sure of what are you trying to do with UIText. However, I *think* you are trying to create a button that has an icon and text on it, right?

If so, you can easily do this with the UIButton and leveraging Scribble's inline images:

on mouseover:


However, in case you *do* want to use UIText for other uses (for example, for creating a text label to display the price of the upgrade, on the right grid cells) you can use it:

Indeed, the UIText does *not* currently have a .setTextFormat() method (I will consider adding it or at least mentioning it in the docu, however the text string itself can be formatted with any Scribble tag. For example:

Note also that this formatting is independent of the position of the UIText within the grid cell, which you can control using the relative_to argument when creating the UIText element.


Here's a sample project with all the code.

Hope it helps, let me know,

Thank you very much, this helped me a lot.
Yes you are right, I wanted Button with a sprite and text, I didn't think about scribbles inline sprites, that was exactly the hint I needed. Now it looks like I wanted it:

Now I can continiue prototyping before I begin to tackle the next UI challenges like scrolling and Tooltips.
I already took a look at your scrolling example you posted in the comments, I am excited to see if I can make a working scrollbar, too.

Glad to know! That game prototype is looking sick!

Thanks, although theres not much to see yet.
I think I fould a little mistake in your code:
self.setSurface = function(_color)            { self.__background_color = _color; return self; }

Yep, that's a blunder! Thanks for pointing it out. Obviously it should be:

self.setSurface = function(_surface)			{ self.__surface_id = _surface; return self; }

I will release a small fix soon.