Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Basic EGP
- @inputs EGP:wirelink
- @outputs
- @persist
- @trigger
- interval(100)
- #[ Centred drawing EGPs use this ]#
- function number entity:touching(EGP:wirelink#[The screen it'll read from]#,I#[The index of the object it's checking]#){
- local Y1 = EGP:egpPos(I):y()-(EGP:egpSize(I):y()/2)
- local X1 = EGP:egpPos(I):x()-(EGP:egpSize(I):x()/2)
- local Y2 = EGP:egpPos(I):y()+(EGP:egpSize(I):y()/2)
- local X2 = EGP:egpPos(I):x()+(EGP:egpSize(I):x()/2)
- local Vpos = EGP:egpCursor(This)
- if(inrange(Vpos,vec2(X1,Y1),vec2(X2,Y2))){
- return 1
- }else{
- return 0
- }
- }
- #include "egp"
- EGP:egpText(6,"Option 3",vec2(430,20))
- EGP:egpText(5,"Option 2",vec2(220,20))
- EGP:egpText(4,"Option 1",vec2(20,20))
- ###############BOXES###################
- EGP:egpBox(3,vec2(460,50),vec2(100,20))
- EGP:egpBox(2,vec2(250,50),vec2(100,20))
- EGP:egpBox(1,vec2(50,50),vec2(100,20))
- if(owner():touching(EGP, 3)){
- EGP:egpText(10,"Option 3 selected",vec2(200,200))
- timer("egpclear",10000)
- }
- if(owner():touching(EGP, 2)){
- EGP:egpText(10,"Option 2 selected",vec2(200,200))
- timer("egpclear",10000)
- }
- if(owner():touching(EGP, 1)){
- EGP:egpText(10,"Option 1 Selected",vec2(200,200))
- timer("egpclear",10000)
- }
- if(clk("egpclear")==1){
- EGP:egpClear()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement