PDA

View Full Version : AutoPlay Media Studio Design Objects (Object Orientated Programming)


ShadowUK
12-06-2008, 12:27 AM
http://orz.luacom.net/before.png

I'm not just talking about OOP, I'm talking about OOP with AMS Objects.

My intention was to have code like this.
-- On Click, Button1.
this:SetText("Hello");

But this is as good.
-- On Click, Button1.
Button1:SetText("Hello");

I've done these objects.

Label
Paragraph
Image


These objects have all the methods they do in AMS such as SetPos, SetSize, GetText, GetProperties, etc.

You can work this example by dragging 'Object.luac' into your AutoPlay/Scripts folder.

Then On Preload put this in somewhere.
GetObjects = require("Object.luac"); -- You can change GetObjects to whatever you want the grab function to be.

Also, didn't post in examples because it takes ages to show up.

Edit:

If your object has a space in the name, It is converted to Object["object name"]:SetText("BLAH");

Centauri Soldier
12-06-2008, 02:59 AM
Very cool idea shadow! I look forward to seeing your other ventures in this field.