Author Topic: layout design  (Read 877 times)

abls1

  • Full Member
  • ***
  • Posts: 50
    • View Profile
layout design
« on: May 26, 2015, 11:50:39 PM »
How do I make layout for AM.. I design some layout in the past for Atomic FE abd I would like to know how to do for AM

Thanks

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 436
    • View Profile
Re: layout design
« Reply #1 on: May 27, 2015, 06:47:19 AM »
Layouts use the Squirrel programming language. Adding objects like text, image, artwork and listbox are a single line of code in a layout.nut file in the AM layouts/layoutname folder.

An example layout would be:
Code: [Select]
//set the layout resolution
fe.layout.width = 800;
fe.layout.height = 600;
//add a text with the current title
local title = fe.add_text("[Title]", 0, 0, fe.layout.width, 30);
//add the snap artwork
local snap = fe.add_artwork("snap", fe.layout.width - 400, 50, 320, 240);
//add the game list
local list = fe.add_listbox( 30, 30, 400, fe.layout.height - 30);

With each object created, you can now adjust the properties using the object variable:
Code: [Select]
title.set_rgb( 200, 200, 0);
snap.alpha = 200;
list.rows = 15;
list.charsize = 22;

You want to look through this for more information on all the available functions and variables you can use:
https://github.com/mickelson/attract/blob/v1.5.2/Layouts.md
« Last Edit: May 27, 2015, 06:48:53 AM by liquid8d »

abls1

  • Full Member
  • ***
  • Posts: 50
    • View Profile
Re: layout design
« Reply #2 on: May 30, 2015, 10:39:31 AM »
After i create the layout how do I make it display?  I do not see an option to choose a layout from a list

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 436
    • View Profile
Re: layout design
« Reply #3 on: May 30, 2015, 01:40:37 PM »
TAB (Configure menu), Displays, [Your Display], hit enter on Layout and use Up/Down to choose.. hit enter, then ESC, ESC to exit out and it should load if there are no errors.

When you are testing a layout, it's best to have it in Window mode so you can see the output and know if there are any errors in your layout.