O'Reilly logo

Lua Game Development Cookbook by Mário Kašuba

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Window controls and interaction

Now that you've got the basic functionality to draw and manipulate windows, you can design your own control elements such as buttons, edit boxes, and many other.

This recipe will show you how to create buttons and edit boxes that users can interact with. There will be three subsections where each one will deal with one king of control element.

Getting ready

This recipe will use the concepts of the previous window element to create window controls. You should be able to create and draw a window and handle input events. You'll be using mouse and keyboard events primarily.

First, you should extend the applicable event types with keyboard operations. You can do this by adding two event handlers, as shown in the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required