Jump to content

Recommended Posts

Posted

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

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Posted

What do you mean do the output? Thats a fairly primitive style of ui but it looks like I'm that certain case yiu would set some variable that causes the app to exit?

Posted

 

Hello, I'm using version 4.3. The idea is to close the application. I do not know if it will delete the button and the world before or leadwerks does that automatically.

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

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.

×
×
  • Create New...