Author Topic: concept layout - need some help  (Read 7187 times)

bundangdon

  • Sr. Member
  • ****
  • Posts: 212
    • View Profile
concept layout - need some help
« on: May 27, 2016, 02:39:16 AM »
Hey all! I've been able to design and put together my own version of the "Concept" layout and it can be seen below here. However, I had a couple of questions.

1) How can I make the games list seamless/continuous? As you can see in the picture (below) it gets caught about halfway when you get to the first or last entries on the games list

2) How can I insert a "title" of the selected game in to the layout? I tried copying some code from other layouts but couldn't get it to work.

Any help or information would be greatly appreciated!  :D


liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: concept layout - need some help
« Reply #1 on: May 28, 2016, 11:33:05 AM »
I'm not sure that the listbox supports wrapping to "fill" the listbox area? Someone with some experience could write a custom WrapListBox class that would do it though.

As for title, that's simple:
fe.add_text("[Title]", 0, 0, fe.layout.width, 20);

You should checkout these for help on how to do things and what is available:
https://github.com/mickelson/attract/wiki/Introduction-to-Squirrel-Programming (specifically the Layouts section)
https://github.com/mickelson/attract/blob/v2.0.0/Layouts.md

bundangdon

  • Sr. Member
  • ****
  • Posts: 212
    • View Profile
Re: concept layout - need some help
« Reply #2 on: May 28, 2016, 08:33:26 PM »
Thank you very much for that helpful information :D

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: concept layout - need some help
« Reply #3 on: May 28, 2016, 08:42:41 PM »
By „title“ do you mean wheel art? It sounds like you can want to create your own class to handle this.
Code: [Select]
fe.game_info(Info.Title) supports index_offset. It shouldn’t be too hard to have 8 text objects in relation to the current game, and one art object for the current game. Obviously you will need some clever logic if there is less games than objects.

bundangdon

  • Sr. Member
  • ****
  • Posts: 212
    • View Profile
Re: concept layout - need some help
« Reply #4 on: May 28, 2016, 09:46:22 PM »
I'm not sure that the listbox supports wrapping to "fill" the listbox area? Someone with some experience could write a custom WrapListBox class that would do it though.

As for title, that's simple:
fe.add_text("[Title]", 0, 0, fe.layout.width, 20);

You should checkout these for help on how to do things and what is available:
https://github.com/mickelson/attract/wiki/Introduction-to-Squirrel-Programming (specifically the Layouts section)
https://github.com/mickelson/attract/blob/v2.0.0/Layouts.md

Just one question though, how can I set the location? Whenever I try to put in any numbers for the location the whole layout gets messed up :P

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: concept layout - need some help
« Reply #5 on: May 29, 2016, 03:27:54 AM »
I'm not sure that the listbox supports wrapping to "fill" the listbox area? Someone with some experience could write a custom WrapListBox class that would do it though.

As for title, that's simple:
fe.add_text("[Title]", 0, 0, fe.layout.width, 20);

You should checkout these for help on how to do things and what is available:
https://github.com/mickelson/attract/wiki/Introduction-to-Squirrel-Programming (specifically the Layouts section)
https://github.com/mickelson/attract/blob/v2.0.0/Layouts.md

Just one question though, how can I set the location? Whenever I try to put in any numbers for the location the whole layout gets messed up :P

fe.add_text( msg, x, y, w, h )

x - the x coordinate of the top left corner of the text (in layout coordinates).
y - the y coordinate of the top left corner of the text (in layout coordinates).

bundangdon

  • Sr. Member
  • ****
  • Posts: 212
    • View Profile
Re: concept layout - need some help
« Reply #6 on: May 29, 2016, 06:00:07 AM »
Finally got it figured out. Thank you to all who helped! :)