Thursday, 28 August 2014

A little GUI Manipulation

ROBLOX allows its developers to script things in the Lua programming language (call it LUA and you'll be shot) to create interesting and intricate things. You could code the launch sequence of a rocket that you built, make a computer operating system, code a fully-fledged game from scratch, or manipulate existing instances.

With Lua I've created what I consider to be a very nice interface for Air: Force. As you can see in some screenshots below of both code and GUI a lot of it is just tweening and making transitions work, but there is a little bit of more complex methodology there. Simple manipulations of GUIs make for great interface/user feedback and transition between GUI elements.

Efficient coding is always a must. The smaller the file size and the more quickly it runs the better the game. It goes without saying that some inefficiencies can probably be found within my own code in the screenshots below. Rest assured; I'll fix it as development progresses.



Click on an image to make it larger.



Meticulously searching for assets to preload on the server via the ContentProvider in the ClientManager. Code is cloned in a LocalScript to be replicated for each client. Also in this picture: configuration for new players entering the server.




A view of some of the code for the loading sequences of the game in the client-side LocalScript.




Ruthlessly efficient coding for the buttons in the main menu.



And that's pretty much how the whole thing works. Sweep in the GUIs, detect when a button is clicked, and on said event perform an action (function).

In Lua terms, it looks like this:
--[[
Code to sweep in UI here
]]

uiButton.MouseButton1Click:connect(function() --The event, connector, and function
--Perform some action such as a new transition here
end)
Well, more or less anyway.

No comments:

Post a Comment