fsdfdsf Posted January 29, 2015 Posted January 29, 2015 how can i make rectangle press ( button)? my code, i want my rectangles to press? local x,y = guiGetScreenSize() function panel() showChat( false ) showCursor( true ) dxDrawRectangle ( x/4, y/3.8, x/4, y/2, tocolor ( 255, 0, 0, 100 ) ) dxDrawRectangle ( x/1.92, y/3.8, x/4, y/2, tocolor ( 0, 255, 0, 100 ) ) end addEventHandler ( "onClientRender", getRootElement(), panel)
Moderators IIYAMA Posted January 29, 2015 Moderators Posted January 29, 2015 For you as beginner, I would recommend you to create a gui button and make it invisible on top of your rectangles. https://wiki.multitheftauto.com/wiki/GuiCreateButton https://wiki.multitheftauto.com/wiki/GuiSetVisible When you are getting better at lua, you can start learning new and cleaner techniques. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now