Jump to content

Button Exit


Yue
 Share

Recommended Posts

Hello in my learning process, I created a simple button to exit the program through the mouse interaction.


The drawback is that I do not know how to do the output?


Any suggestions?


 

function Script:PostRender(context)
	
	context:SetBlendMode(Blend.Alpha)
	context:DrawImage(baseBoton,100,100,128,128)
	context:DrawText("EXIT",145,155 )
	
	 context:DrawText("Mouse position: "..window:GetMousePosition():ToString(), 2, 2)
	
	


	local mouse = window:GetMousePosition()


	if mouse.x > 100  and mouse.x < 225 then

		if mouse.y > 146 and mouse.y < 176 then

			context:DrawText("Over Button", 2, 20)
			
			if window:MouseDown(Key.LButton) then 

				
				
			end 


		end
	end 


	context:SetBlendMode(Blend.Solid)


end

 

Exit.png

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...