@dave1707 I got a error in my code and I been trying to fix it. Can you help
-- SynOSX
-- Created By: AveryDee
-- Coded By: AveryDee
function setup()
displayMode(FULLSCREEN)
func=desktop
-- Plugins
pos = vec2(10,300)
size = vec2(202,342)
-- Default Applacations
da1=dmg(WIDTH/2,HEIGHT-200,100,50,"Finder")
da2=dmg(WIDTH/2,HEIGHT-400,100,50,"TextEdit")
da3=dmg(WIDTH/2,HEIGHT-600,100,50,"SynStore")
-- Downloaded Applacations
-- Exit Buttons
xb1=X(WIDTH/2,HEIGHT-200,100,50,"Desktop")
xb2=X(WIDTH/2,HEIGHT-300,100,50,"Desktop")
xb3=X(WIDTH/2,HEIGHT-400,100,50,"Desktop")
end
function draw()
background(40, 40, 50)
func()
end
function touched(t)
Finder:touched(t)
if t.state==BEGAN then
if func==desktop and da1:touched(t)=="Finder" then
func=easy
elseif func==desktop and da2:touched(t)=="TextEdit" then
func=normal
elseif func==desktop and da3:touched(t)=="SynStore" then
func=hard
elseif func==easy and xb1:touched(t)=="Desktop" then
func=desktop
elseif func==normal and xb1:touched(t)=="Desktop" then
fund=desktop
elseif func==hard and xb1:touched(t)=="Desktop" then
func=desktop
end
end
end
function desktop()
background(167, 125, 96, 255)
da1:draw()
da2:draw()
da3:draw()
end
function Finder()
background()
Finder:draw()
end
function TextEdit()
background(0,0,255)
fill(255)
text("NORMAL Screen",WIDTH/2,HEIGHT/2)
nb1:draw()
end
function SynStore()
background(0,0,255)
fill(255)
text("HARD Screen",WIDTH/2,HEIGHT/2)
hb1:draw()
end
-- Default Applacations
Finder = class()
function Finder:draw()
background()
spriteMode(CORNER)
sprite("Documents:Finder",pos.x,pos.y,650)
end
function Finder:touched(t)
tpos = vec2(t.x,t.y)
if tpos.x>=pos.x and tpos.x<=pos.x+size.x and tpos.y>=pos.y and tpos.y<=pos.y+size.y then
if t.state == BEGAN then
anchor = tpos - pos
end
end
if anchor then pos = tpos - anchor end
if t.state == ENDED then anchor = nil end
end
-- .dmg
dmg = class()
function dmg:init(x,y,w,h,txt)
self.x=x
self.y=y
self.w=w
self.h=h
self.txt=txt
end
function dmg:draw()
rectMode(CENTER)
fill(255)
rect(self.x,self.y,self.w,self.h)
fill(255,0,0)
text(self.txt,self.x,self.y)
end
function dmg:touched(t)
if t.state==BEGAN then
if t.x>self.x-self.w/2 and t.x<self.x+self.w/2 and
t.y>self.y-self.h/2 and t.y<self.y+self.h/2 then
return self.txt
end
end
end
-- Exit
X = class()
function X:init(x,y,w,h,txt)
self.x=x
self.y=y
self.w=w
self.h=h
self.txt=txt
end
function X:draw()
rectMode(CENTER)
fill(255)
rect(self.x,self.y,self.w,self.h)
fill(255,0,0)
text(self.txt,self.x,self.y)
end
function X:touched(t)
if t.state==BEGAN then
if t.x>self.x-self.w/2 and t.x<self.x+self.w/2 and
t.y>self.y-self.h/2 and t.y<self.y+self.h/2 then
return self.txt
end
end
end