Heres The DownLoad For It "You Will Need To Update Main.lua"
http://www.mediafire.com/?gq6rnsdp19pt5li
Heres The Code If You Dont Want To Download
It All Runs In main.lua No Other Files Needed "Beside Fonts"
Code: Select all
function love.load()
love.graphics.setCaption ("Hello World")
Icon = love.graphics.newImage ("Icon.png")
love.graphics.setIcon (Icon)
love.graphics.setBackgroundColor (237,145,0)
Error = love.graphics.newImage ( "ErrorScreen.png" )
DropArrow = love.graphics.newImage ( "DropDown.png" )
Font = love.graphics.newImageFont ( "Font.png", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 " )
FontTwo = love.graphics.newImageFont ( "FontTwo.png", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789" )
love.graphics.setFont ( Font )
end
function HighLight(Title,RecPosX,RecPosY,RecWidth,RecHeight)
--All the local variable get initialize in this area
local Title = Title
local TitleLength = string.len(Title)
local TitleDivided = TitleLength/2
local RecPosX = RecPosX
local RecWidth = RecWidth
local RecPosY = RecPosY
local RecHeight = RecHeight
local MousePosX = love.mouse.getX()
local MousePosY = love.mouse.getY()
--This is for detecting if the mouse is inside the rectangle. Then hilights the box
if MousePosY > RecPosY and MousePosY < RecPosY+RecHeight and MousePosX > RecPosX and MousePosX < RecPosX+RecWidth then
love.graphics.setColor (50,50,50)
love.graphics.rectangle ("fill",RecPosX+1,RecPosY+1,RecWidth-2,RecHeight-2)
else end
love.graphics.setColor (0,0,0)
love.graphics.rectangle ("line",0,0,180,40)
love.graphics.setColor (150,100,50,220)
love.graphics.print ("Mouse Pos X "..MousePosX,0,0,0,2,2)
love.graphics.print ("Mouse Pos Y "..MousePosY,0,20,0,2,2)
love.graphics.setColor (0,0,0)
love.graphics.rectangle ("fill",RecPosX,RecPosY,RecWidth,RecHeight)
--This is for detecting if the mouse is inside the rectangle. Then hilights the box
if MousePosY > RecPosY and MousePosY < RecPosY+RecHeight and MousePosX > RecPosX and MousePosX < RecPosX+RecWidth then
love.graphics.setColor (50,50,50)
love.graphics.rectangle ("fill",RecPosX+1,RecPosY+1,RecWidth-2,RecHeight-2)
else end
--The title displayed in the rectangle
love.graphics.setColor (255,255,255)
love.graphics.print (Title,RecPosX+RecWidth-TitleDivided,RecPosY+RecHeight/2,0,RecWidth/50,RecHeight/50)
--love.graphics.draw (DropArrow,RecPosX+RecWidth,RecPosY,0,RecWidth/11,RecHeight/11)
end
function love.draw()
--Calling the HighLight
HighLight("Hello",180,0,400,40)
HighLight("Play",300,100,400,400)
end