Author Topic: Possible to put an icon next to game name in rom list?  (Read 122 times)

wrybread

  • Full Member
  • ***
  • Posts: 71
    • View Profile
Possible to put an icon next to game name in rom list?
« on: September 24, 2020, 09:10:13 PM »
I made my layout show a little cocktail glass icon in the bottom right when the currently selected game supports cocktail mode (let me know if anyone is interested in that, email me at my username at gmail), but I think it would be nicer if it put that icon in the romlist next to each game that supports cocktail mode.

So I'm wondering: how do I put icons next to each game in the list?

Here's the part of my layout that deals with the romlist:

Code: [Select]
// this is the ROM list
local lb = fe.add_listbox( 0, 220, fe.layout.width, fe.layout.height-450);
lb.charsize = 40
lb.set_sel_rgb( 200, 200, 64 );
lb.sel_style = Style.Bold;
lb.selbg_alpha=0;
lb.rows = 15;

Attached is a screenshot of my layout, note the cocktail glass at bottom right.

Is there some way to put an icon next to each game name? I can work out the conditionals, just need help putting any static icon next to the text.
« Last Edit: September 24, 2020, 09:14:16 PM by wrybread »

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1165
    • View Profile
Re: Possible to put an icon next to game name in rom list?
« Reply #1 on: September 26, 2020, 05:55:08 AM »
Few ideas:
  • Custom font. font-awesome is a good example. Then figure out how to add the icon to the font you are using.
  • Add Image next to list item.
  • Create text objects instead of list. Get length of text. Show visibility for image and place it next to text.