Here's how it works: egpClear() just wipes the board of everything, you don't want that unless you're changing the objects you have assigned to certain indexes (otherwise you can simply move them around and edit their size).
Here's an example of what you want:
Code:
@inputs Screen:wirelink
@inputs Energy
@trigger Energy
if(first()|dupefinished())
{
Screen:egpText(1,Energy:toString(),vec2(5,5))
}
Screen:egpSetText(1,Energy:toString())
So you have you input energy (or whatever), and the first time around the chip creates the text object under the index of 1 and gives it a value of whatever the energy is. Then every time the Energy changes to a different value (that's what @trigger does), it'll change the text to reflect the new value.
I should be more specific: the @trigger runs the ENTIRE script when any input listed in the @trigger changes. That means if you add other code in there and use an interval or whatever, you'll want to put that "Screen:egpSetText(1,Energy:toString())"
into an "if(clk()){}"
I'm fairly sure that only returns 1 if the chip is executing due to an input change.
Bookmarks