Author Topic: [HELP] Adjust the position of the selected game  (Read 1796 times)

arthurvalenca

  • Sr. Member
  • ****
  • Posts: 125
    • View Profile
[HELP] Adjust the position of the selected game
« on: September 16, 2018, 09:55:32 AM »
Hello everyone I'm having a hard time adjusting the position of the game when it is selected, natively it comes in the middle of the layout, I would like to adjust it more to the left over the "play game" image, please can anyone help?




Below I leave the code I'm using for someone to help.

Layout.nut:

Code: [Select]
// Include the converyour helper module
fe.load_module("conveyor_helper");

/*
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Horizontal List Demo
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A horizontal List with all valid options
Omitted options will use the defaults

*/

// initialize the horizontal list
local hList = MyGameList();

// ----------- General List Options -----------
hList.type = ch.Linear_Horizontal; // OPTIONS: ch.Spinwheel / ch.Linear_Vertical / ch.Linear_Horizontal
hList.bend.direction = ch.Right;  // OPTIONS: ch.Left / ch.Right
hList.x = 0; // OPTIONS: top left x-coordinate if gamelist is linear or the center x-coordinate if a spinwheel
hList.y = 195; // OPTIONS: top left y-coordinate if gamelist is linear or the center y-coordinate if a spinwheel
hList.width = fe.layout.width; // OPTIONS: linear game list total width in pixels
hList.height = 500; // OPTIONS: linear list's height in pixels
hList.ms_speed = 300; // OPTIONS: in milliseconds, sets the speed of the conveyor
hList.fade_after_nav = 255; // OPTIONS: 0-255 Fades the entire gamelist's alpha channel after navigation to this value. set to 255 to disable fading
hList.fade_delay = 1000; // the amount of time in milliseconds before the fade should start
hList.fade_speed = 1; // the mulitplier controlling the speed of the fade
hList.fade_selected = false; // OPTIONS: TRUE/FALSE fade selected game if gamelist fading is active

// ----------- Linear List options -----------
hList.linear.padding = 10; // the amount of padding in pixels between each gamelist item

// ----------- List Item  Options -----------
hList.item.contentTemplate = ch.Custom; // OPTIONS: ch.Artwork / ch.Text / ch.Artwork_and_Text / ch.Artwork_or_Text / ch.Flyer_and_Artwork
hList.item.count = 5; // OPTIONS: Total number of gamelist items to display
       
hList.item.sizeScaling.low = 0.90; // OPTIONS: 0-100 Scaling size percentage to use for the item furthest from the selected item
hList.item.sizeScaling.high = 0.90; // OPTIONS: 0-100 Scaling size percentage to use for item closest to the selected item
hList.item.sizeScaling.currentlySelected = 1.15; // OPTIONS: 0-100 Scaling size percentage to use for the currently selected item
       
hList.item.alphaScaling.low = 255; // OPTIONS: 0-100 Scaling size percentage to use for the item furthest from the selected item
hList.item.alphaScaling.high = 255; // OPTIONS: 0-100 Scaling size percentage to use for item closest to the selected item
hList.item.alphaScaling.currentlySelected = 255; // OPTIONS: 0-100 Scaling size percentage to use for the currently selected item
       
hList.item.height = 500; // OPTIONS: Height of each gameList item in pixels before scaling - dynamic with linear vertical lists
hList.item.width = 270; // OPTIONS: Width of each gameList item in pixels before scaling - dynamic with linear horizontal lists
       
hList.item.margin.left = 0; // OPTION: bounding box left margin size for all images and text
hList.item.margin.right = 12; // OPTION: bounding box right margin size for all images and text
hList.item.margin.top = 12; // OPTION: bounding box top margin size for all images and text
hList.item.margin.bottom = 12; // OPTION: bounding box bottom margin size for all images and text
       
// ----------- List Item Content: borders / backgrounds / gloss / colors  -----------
hList.item.toggle.backgroundColor = false; // if set to "TRUE" the game item background can be colored (use item.normal.color)
hList.item.toggle.backgroundFile = false; // if set to "TRUE" the game item will use a file as the background (file: item_backgroundFile.png)
hList.item.toggle.selectedBackgroundColor = true; // if set to "TRUE" the selected game item background can be colored (use item.currentlySelected.color)
hList.item.toggle.selectedBackgroundFile = false; // if set to "TRUE" the selected game item will use a file as the background (file: item_selectedBackgroundFile.png)
hList.item.toggle.glossOverlay = false; // if set to "TRUE" will overlay the game item with a gloss file (file: item_glossOverlay.png)
hList.item.toggle.borderOverlay = false; // if set to "TRUE" will overlay the game item with a boarder file (file: item_borderOverlay.png)

hList.item.normal.color.red = 0; // OPTIONS: background red color channel 0 - 255
hList.item.normal.color.green = 0;                // OPTIONS: background green color channel 0 - 255
hList.item.normal.color.blue = 0;                  // OPTIONS: background blue color channel 0 - 255
       
hList.item.currentlySelected.color.red=255; // OPTIONS: background red color channel 0 - 255
hList.item.currentlySelected.color.green=0;        // OPTIONS: background green color channel 0 - 255
hList.item.currentlySelected.color.blue=0;        // OPTIONS: background blue color channel 0 - 255
       
// ----------- List Item Content: Text -----------
hList.text.message = "[Title]";
hList.text.alignment = Align.Centre;  // OPTIONS:left/right/center
hList.text.normal.font = "Arial";
hList.text.normal.size = 18; // OPTIONS: text font size for every gameList item
hList.text.normal.color.red = 0; // OPTIONS: text font red color channel 0 - 255
hList.text.normal.color.green = 0; // OPTIONS: text font green color channel 0 - 255
hList.text.normal.color.blue = 255; // OPTIONS: text font blue color channel 0 - 255

hList.text.currentlySelected.font = "Arial";
hList.text.currentlySelected.size = 24; // OPTIONS: text font size for every gameList item
hList.text.currentlySelected.color.red = 255; // OPTIONS: text font red color channel 0 - 255
hList.text.currentlySelected.color.green = 0; // OPTIONS: text font green color channel 0 - 255
hList.text.currentlySelected.color.blue = 0;  // OPTIONS: text font blue color channel 0 - 255
       
// ----------- List Item Content: User Defined Artwork -----------
hList.artwork.type = "wheel"; // OPTIONS: name of the artwork to use for the conveyour
hList.artwork.type2 = "snap"; // OPTIONS: name of the artwork to use for the conveyour setting "Flyer_and_Artwork"
hList.artwork.preserveAspect = true; // OPTIONS: true / false


//---------------------------------------------------------
//
// Configure a custom game item instead of using the built
// in settings
//
//---------------------------------------------------------
if (hList.item.contentTemplate == ch.Custom)
{
local object = hList;
local temp = null;
local x = 0
local y = 0
local w = object.item.width
local h = object.item.height

//--------------------------------------------------------------------------------
// The Artwork and text object order is important because it determines the
// correct working of the text fallback function when artwork is not available.
// If the automatic process does not handle this correctly, it can specifically be
// set using the properties: 'text_fallback_index' and 'artwork_text_index'.
// The index numbers are calculate using the example below.
//--------------------------------------------------------------------------------


// Artwork index #2 - Flyer frame (Artwork index 0 & 1 are always background and selected images)
temp = object.add_customGameItemContent("image", fe.script_dir + "frameflyer.png", 8 , 0 , w-16 ,h );
temp.preserve_aspect_ratio = false;
temp.trigger = Transition.EndNavigation;

// Artwork index #3 - Game Flyer
temp = object.add_customGameItemContent("artwork", "flyer", 20 , 20 , w-40 ,h-40 );
temp.preserve_aspect_ratio = false;
temp.trigger = Transition.EndNavigation;

// Text index #0 - the word 'AttractMode Test' just written to the left of the flyer
temp = object.add_customGameItemContent("text", "AttractMode Test", x + object.text.normal.size/2, 10, h, 0);
temp.font = object.text.normal.font;
temp.align = Align.Left;
temp.charsize  = 12;
temp.rotation = 90;

// Artwork index #4 - show a video of the game and set the shader
//temp = object.add_customGameItemContent("artwork", "snap", w - w*0.40 , h - h*0.30 , w*0.40 ,h*0.30 );
//temp.preserve_aspect_ratio = false;
//temp.trigger = Transition.EndNavigation;
//local sh = fe.add_shader( Shader.VertexAndFragment, "shaders/crt.vert", "shaders/crt.frag" );
//sh.set_param( "rubyInputSize", 320, 240 );
//sh.set_param( "rubyOutputSize", ScreenWidth, ScreenHeight );
//sh.set_param( "rubyTextureSize", 320, 240 );
//sh.set_texture_param("rubyTexture");
//temp.shader = sh;

// Artwork #5 - add tvframe to the video
temp = object.add_customGameItemContent("image","TVframe.png",w - w*0.40 , h - h*0.30 , w*0.40 ,h*0.30 )

// Text object #1  - this will be configured as the 'text_fallback_index' because it has the name of the game
temp = object.add_customGameItemContent("text", "[Title]", x, h*0.5, w, 0);
temp.font = object.text.normal.font;
temp.charsize  = object.text.normal.size;
temp.align = object.text.alignment;

// insert Favorite Banner
object.add_favoriteImage(fe.script_dir + "favorite2.png", 8 , 2 , w-40 ,h-40);

// --------------------------------------------------------------------------------------------------------
// the next three settings are optional. Use gi_textFallback to activate the automatic showing of text,
// when artwork is not available for a game. The setting of  'text_fallback_index' and 'artwork_text_index'
// should only be used the automatic process is not working or the conveyour handling of the test is just wrong.
// --------------------------------------------------------------------------------------------------------
object.gi_textFallback = true;
object.text_fallback_index= 1; // text object to turn off/on when the "artwork_test_index" is not available
object.artwork_test_index = 3; // test for this artwork index if the game text should be shown

}
// show the horizontal list
hList.show();

Module Download:

http://www.mediafire.com/file/c5pc8873h1uublm/conveyor_helper.rar/file