This is sort of a two part question:
In my game I'm having performance issues on my laptop for some of the effects (fullscreen resolution cloud fog effects with animations) so I decided to add a persistent variable to toggle the animations.
Part 1:
Then I decided it'd be useful to add it as an option in the preference menu. Easy enough, I just copy some code from the preference screen, used SetField to update the persistent variable instead.
The Problem:
I want to indicate what the current performance is set to and highlight (or dim the other) the buttons accordingly. I've tried:
Code: Select all
style k_pref_button_on is pref_button:
color "#fff"
style k_pref_button_off is pref_button:
color "#555"
Code: Select all
textbutton _("Normal effects"):
action SetField(persistent,"performance", "high")
if persistent.performance == "high":
style "k_pref_button_on"
else:
style "k_pref_button_off"
textbutton _("Low effects"):
action SetField(persistent,"performance", "low")
if persistent.performance == "low":
style "k_pref_button_on"
else:
style "k_pref_button_off"
Part 2:
My second question is really whether I can optimise the performance in general? Even when using a 160x100 png file (with alpha transparency) using the following loop, my laptop noticeably heats up:
Code: Select all
image fog headache heavy:
"assets/fog-1.png"
size (1280, 800)
linear 2 alpha 0.5
linear 2 alpha 1.0
repeat
Thank you!