Custom Interface

Started by theo, March 21, 2015, 03:20:17 AM

Previous topic - Next topic

theo

How can you make a custom interface with CRPL? I seen maps that have buttons with images you can click. One had a button to build walls. A button with a wall and it's cost. Can someone show me a example of how to do this?

TheDutcher

Since I lack the information on how to do this, I can give you an alternative:

If you know what map it is you can view it's source. This includes all CRPL scripts.
Click here to find out how to import a map and view it's source.

If you don't mind, I'd like to know what map(s) has/have such custom graphical elements. So listing their names here would be much appreciated.

theo

I found out how to do it. You call setscreenmode and the core is no longer attached to the map setscreencords sets it's position but I will have to search for someway to detect if the player clicks on the button

TheDutcher

That's done very easy actually.
First you call either GetMouseButton, GetMouseButtonDown or GetMouseButtonUp (I suggest GetMouseButtonUp).
Since you know where you set your button, you just check if the mouse is on top of your button with GetMousePosition when the mouse button has been pressed.