aboy5643a
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2785 |
|
|
| 14 Sep 2011 08:08 PM |
Is there an efficient (or easy...) way to share a complex GUI. This is kinda crucial in my recreation of Ace of Spades. Only less Minecwaft and more Terrawia :P The GUI is fairly complex though, and can't be cloned/removed once a frame (the speed I'm aiming for.)
"I like dooly-bops" -- ArceusInator |
|
|
| Report Abuse |
|
|
LocalChum
|
  |
| Joined: 04 Mar 2011 |
| Total Posts: 6906 |
|
|
| 14 Sep 2011 08:45 PM |
| Fail F5. You need at least 50 views per second to make it good. :3 |
|
|
| Report Abuse |
|
|
|
| 14 Sep 2011 08:45 PM |
My F5 bot is only like 8 F5's per sec :c
I gotta learn C++... |
|
|
| Report Abuse |
|
|
LocalChum
|
  |
| Joined: 04 Mar 2011 |
| Total Posts: 6906 |
|
| |
|
mew9O3
|
  |
| Joined: 10 Jun 2011 |
| Total Posts: 179 |
|
| |
|
XlegoX
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 14955 |
|
|
| 14 Sep 2011 10:51 PM |
Make a utility class which does it, here's my technique for shared stuff:
function Make_GuiTarget_For(player) ... end
function Make_GuiTarget_Group() function addTarget(target) function remTarget(target) function addGuiFactory(factory) function remGuiFactory(factory) end
function MakeGui_SomeGui_Model() function setSomeState event onSomeStatChange end
function MakeGui_SomeGui_View(model) local myGui = Instance.new(...) model.onSomeStatChange.connecxt(function() ...edit myGui end) end
usage:
_G.GlobalGroup = Make_GuiTarget_Group() game.Players.ChildAdded:connect(function(p) GlobalGroup.addTarget(Make_GuiTarget_For(p)) end) local SomeGuiModel = MakeGui_SomeGui_Model() GlobalGroup.addFactory(function() return Make_SomeGui_View(SomeGuiModel) end) SomeGuiMode.setSomeStat( value )
That's just a general pseudo-code of how I do it. If nyou want to make a more complex system with some shared and some unshared stuff you pretty much have to do things like that, or else it'll get out of hand. It looks like overkill but once you have it set up then it's worth it for the cleaner code. |
|
|
| Report Abuse |
|
|
mew9O3
|
  |
| Joined: 10 Jun 2011 |
| Total Posts: 179 |
|
|
| 14 Sep 2011 10:55 PM |
"model.onSomeStatChange.connecxt(function()" model.onSomeStatChange.connect(function()*
"If nyou" If you*
|
|
|
| Report Abuse |
|
|