Results 1 to 3 of 3

Thread: [EGP Help] Spacebuild Screen

  1. #1
    Wire Noob architectcobra's Avatar
    Join Date
    Jun 2011
    Posts
    2

    Exclamation [EGP Help] Spacebuild Screen

    I play Spacebuild a lot, and one of the things that is really helpful is making a EGP screen to track your ships Resources.

    I can wire all the Resources together just fine, but this is my prob...

    The Problem: Can't seem to find out how to Refresh the EGP to actively output my current Resources, is there a command i am missing?

    I found a EGP code from the internet, but it's built for EGP v2, not EGP v3.

    Here is the 2 lines I use.

    _________________

    Egp:egpClear()

    Egp:egpDraw()
    _________________

    But EGP v3 does not Know what "EGP:egpDraw()" is.

    Can anyone help?

  2. #2
    Developer Jack37's Avatar
    Join Date
    Jul 2009
    Location
    Slovakia
    Posts
    1,329

    Default Re: [EGP Help] Spacebuild Screen

    EGPv3 does not use egpDraw() command. Remove this, and use egpText to write resources to screen. It will update automatically as some of the resource changes.

    Only the small secrets need to be protected. The big ones are kept secret by public incredulity.

  3. #3
    Wire Amateur Critical Mass's Avatar
    Join Date
    Feb 2011
    Posts
    92

    Default Re: [EGP Help] Spacebuild Screen

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
unnecessary
unnecessary
unnecessary
unnecessary
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots