@Killer.Jo - played around a bit, not sure if this is what you had in mind but seems to work OK, may need a little fine tuning. Added a few extras.
I left an aid in to show where the touch is picked up on the screen. To see it you have to set LocRect to True. Hope that helps
viewer.mode = FULLSCREEN
function setup()
--
-- Coins
Coins = 0
option = ""
menuOpt = ""
menu = vec2(800,180)
skiner = vec2(800,300)
farmer = vec2(550,700)
boxer = vec2(200,200)
character = vec2(550,500)
chester = vec2(550,790)
chestClosed = vec2(150,500)
butnX = vec2(900,680)
option = "Start11"
locRect = false
end
function draw()
--
aspect = HEIGHT/WIDTH
if aspect > 1 then
background(0, 233)
pushStyle()
font("Georgia-BoldItalic")
fontSize(32)
fill(255, 14, 0)
textMode(CENTER)
text("Please Run In Landscape Mode", WIDTH/2,HEIGHT/2)
popStyle()
else
if option == "Start11" then
background(0)
sprite(pics[13], butnX.x, butnX.y)
pushStyle()
fill(128,0,0)
font("Georgia-BoldItalic")
fontSize(64)
textMode(CENTER)
text("Farmer Game", WIDTH/2, HEIGHT/2)
fill(255,0,0)
text("Farmer Game", WIDTH/2+4, HEIGHT/2+4)
fontSize(32)
fill(128,0,0)
text("by - Killer Jo",WIDTH/2, HEIGHT/2-64)
popStyle()
elseif option == "menu" then
background(colr[1])
font("ArialRoundedMTBold")
text("Start", 800, 170)
fontSize(20)
fill(255, 27, 0)
sprite(pics[2], skiner.x, skiner.y)
if locRect then testRect(skiner.x,skiner.y,120) end
text("Box", 800, 200)
if locRect then testRect(800,180,80) end
sprite(pics[3], farmer.x, farmer.y)
text("Farm (Island)", 550, 640)
if locRect then testRect(farmer.x,farmer.y,80) end
sprite(pics[4], boxer.x, boxer.y)
text("Your 2. Box", 200, 116)
if locRect then testRect(boxer.x,boxer.y,92) end
sprite(pics[5], character.x, character.y)
if locRect then testRect(character.x,character.y-16,100) end
sprite(asset.builtin.Planet_Cute.Chest_Closed, chestClosed.x, chestClosed.y)
if locRect then testRect(150,474,128) end
elseif option == "skiner" then
background(colr[2])
sprite(pics[13], butnX.x, butnX.y)
elseif option == "farmer" then
background(colr[3])
sprite(pics[13], butnX.x, butnX.y)
elseif option == "boxer" then
background(colr[4])
sprite(pics[13], butnX.x, butnX.y)
elseif option == "chestClosed" then
background(colr[5])
sprite(pics[8], butnX.x, butnX.y)
elseif option == "character" then
background(colr[6])
sprite(pics[13], butnX.x, butnX.y)
end
end
end
function touched(t)
--
if t.state == ENDED then
if t.pos.x >= butnX.x-75 and t.pos.x <= butnX.x+75 then
if t.pos.y >= butnX.y-19 and t.pos.y <= butnX.y+19 then
option = "menu"
end
elseif t.pos.x >= 800-75 and t.pos.x <= 800+75 then
if t.pos.y >= 150-19 and t.pos.y <= 150+19 then
option = "skiner"
sprite(pics[13], butnX.x, butnX.y)
elseif t.pos.y >= 300-19 and t.pos.y <= 300+19 then
option = "skiner"
sprite(pics[13], butnX.x, butnX.y)
end
elseif t.pos.x >= 550-75 and t.pos.x <= 550+75 then
if t.pos.y >= 700-46 and t.pos.y <= 700+46 then
option = "farmer"
sprite(pics[13], butnX.x, butnX.y)
end
elseif t.pos.x >= 200-75 and t.pos.x <= 200+75 then
if t.pos.y >= 200-19 and t.pos.y <= 200+19 then
option = "boxer"
sprite(pics[13], butnX.x, butnX.y)
end
elseif t.pos.x >= 150-75 and t.pos.x <= 150+75 then
if t.pos.y >= 500-19 and t.pos.y <= 500+19 then
option = "chestClosed"
sprite(pics[13], butnX.x, butnX.y)
end
elseif t.pos.x >= 570-75 and t.pos.x <= 570+75 then
if t.pos.y >= 480-50 and t.pos.y <= 480+50 then
option = "character"
sprite(pics[13], butnX.x, butnX.y)
end
elseif option == "skiner" or option == "farmer" or option == "boxer" or option == "character" and t.pos > vec2(0,0) then
option = "menu"
sprite(pics[13], butnX.x, butnX.y)
end
end
-- print(t.pos)
-- print("Option : "..option)
end
menu = vec2(800,150) -- ski text
skiner = vec2(800,300) -- ski images
farmer = vec2(550,700) -- farmer
boxer = vec2(200,200) -- box icon
character = vec2(550,500) -- character icon
chester = vec2(550,600) -- start icon
chestClosed = vec2(150,500) -- closed chest image
pics = {
asset.builtin.UI.Green_Button_00,
asset.builtin.SpaceCute.Beetle_Ship,
asset.builtin.Platformer_Art.Block_Grass,
asset.builtin.Small_World.Watch_Tower,
asset.builtin.Planet_Cute.Character_Pink_Girl,
asset.builtin.Planet_Cute.Chest_Closed,
asset.builtin.Blocks.Glass,
asset.builtin.UI.Blue_Box_Cross,
asset.builtin.Blocks.Dirt_Snow,
asset.builtin.Blocks.Dirt,
asset.builtin.Planet_Cute.Character_Boy,
asset.builtin.Blocks.Glass,
asset.builtin.UI.Blue_Button12
}
colr = {
color(0, 229, 255), -- menu
color(229, 97, 229, 247), -- jetski
color(85, 130, 61), -- farmer
color(138, 83, 79),
color(169, 149, 73),
color(255, 245, 0)
}