Author Topic: Help making a modification to the theme Silky for personal use  (Read 2622 times)

Neil

  • Full Member
  • ***
  • Posts: 46
    • View Profile
Help making a modification to the theme Silky for personal use
« on: January 23, 2019, 11:48:01 AM »
Hello,

I'm trying to make a few tweaks to the theme called Silky by Oomek. I really love this theme, but there are a few tweaks I would like to implement such as being able to keep the flyer aspect ratio. I also would like to bring in the text at the bottom (bring it up) and the texts at the top (bringing them down a bit) so that they may fit on a crt with overscan.

So for the aspect ratio I took the lines of code straight out of Gamestation and added in

At the very top>

 </ label="Flyer Aspect Ratio", help="Flyer preserve aspect ratio", options="Yes,No", order=8 /> ratio="No"


& under>   

//Flyer

 if ( my_config["ratio"] == "No" ){
   flyer.preserve_aspect_ratio = false
}
 else{
   flyer.preserve_aspect_ratio = true
}


I also removed the semi colons since it seems to not be in Oomek's style so I didn't want to disrupt anything. Here's the saved .nut that goes into the Silky folder with the edits above.


It appears to work for now, at least at keeping the aspect ratio true to the original png's, but is this the proper approach to doing so?


Now secondly how can I bring in the texts at the top and bottom a bit so that they may always be visible on a crt?

Thank you.
« Last Edit: January 23, 2019, 11:56:32 AM by Neil »

rand0m

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Help making a modification to the theme Silky for personal use
« Reply #1 on: January 23, 2019, 11:39:40 PM »
1- Firstly it will be good to rename your customized Silky to Silky-Mix or something and keep original Silky so you can check the original if need arises.

2- Local variables can be declared anywhere. In the theme following creates a local variable "flyer"
Quote
Code: [Select]
local flyer = fe.add_artwork("flyer", flw + flx - crw - flyerW, bth, flyerW, flyerH )

3- Since the title of local variable is flyer, you can add any further instructions naming it (2nd will make flyers preserve aspect ratio):
Quote
Code: [Select]
flyer.mipmap = true;
flyer.preserve_aspect_ratio = true;

4- my_config is used when you want to create layout options. If you only want to use the layout personally then directly using preserve aspect ratio in layout will be enough (above example). If you plan to share it or might use it in environment where ratio needs to be turned on/ off then creating layout options is better. You can check the code by going to layout options and turn on/ off aspect ratio.

5- About changing the position of text in top and bottom, well the layout is very populated and if you make any changes to position of one item you might have to change the position of all items plus values are not directly given (like: 80, 100, 200, 500) so it will take a lot of effort to resize.

Neil

  • Full Member
  • ***
  • Posts: 46
    • View Profile
Re: Help making a modification to the theme Silky for personal use
« Reply #2 on: January 24, 2019, 11:57:59 AM »
Thank you. That worked. I was able to clean it up a little and the option for the flyer aspect ratio yes / no in the layout options shows up and works correctly as well. As for the text, well once properly calibrated it doesn't stand out quite as badly so I think leaving it this way will work fine (not worth the trouble at this point).

I really appreciate the tips and it's a lot of fun to work on Squirrel which is very similar to other object oriented languages I have studied.