|
| 27 Mar 2015 10:05 PM |
Thinking of make a markup language for Guis [programmed in Lua]. Do you think anyone would ever use it? I have an example of what the syntax might look like. Check it out and tell me what you think! http://www.roblox.com/Example-item?id=230941778 |
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 27 Mar 2015 10:07 PM |
| I'm not exactly sure what you mean, even after reading the script. |
|
|
| Report Abuse |
|
|
Tuneable
|
  |
| Joined: 16 Feb 2013 |
| Total Posts: 2932 |
|
|
| 27 Mar 2015 10:08 PM |
What I used to do for guis is use an anaminus plugin to serialize all of the objects into create form.
local Create = LoadLibrary("RbxUtility").Create
Create "TextButton" { Name = "Blah"; BackgroundColor3 = Color3.new(0, 0, 0); } |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 10:10 PM |
@Klink HTML for Roblox Guis
@Tune I'm aware of that utility, but I hope to make it even more efficient. |
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 27 Mar 2015 10:12 PM |
| That would be cool, I personally don't think I'd use it for anything but playing around with but it would still be cool and could possibly come in handy down the road. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 27 Mar 2015 10:15 PM |
Nah just make a whole language :) Example: [[ newFrame "frame name" in script.Parent setPosition xScale xOffset yScale yOffset setSize xScale xOffset yScale yOffset submit // pushes it create // creates the last pushed object
newTextLabel "text label name" in $-1 // $-1 means last object created setPosition xScale xOffset yScale yOffset setText "hello, world!" submit create
// to push an already existing GUIObject get "asd" in script.Parent submit ]]
idk |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 27 Mar 2015 10:17 PM |
or you can make it more general by doing like: set "text" "hello, world!" idk so it works for any instance |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 10:18 PM |
That's very possible, cnt. Main issue is that it couldn't include any script tags, as they don't have permission to access/change the Source property. I COULD make it into a plugin and that would solve the problem. My original plan was to use a ModuleScript. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 27 Mar 2015 10:19 PM |
| It would be better as a plugin, since no one should really be building GUIs in-game anyways? |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 10:19 PM |
| I would imagine a CSS style. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 27 Mar 2015 10:20 PM |
| Sorry, '// $-1 means last object created' should mean last object pushed, not craeted. |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 10:21 PM |
Current ideas for syntax: HTML New language (cnt's idea) CSS (Cease's idea)
No matter which way it goes, the string matching is going to hurt my head. I have some pretty solid ideas on how to do it, but it's still going to hurt. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 27 Mar 2015 10:23 PM |
| Mine would make the string matching easy since there is a set number of instructions and each new line (or maybe semi-colon, whatever) is a new instruction. |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 10:25 PM |
I was a little worried about my idea, because what happens when I come to positions?
(tag)Name="hi",Position=UDim2.new(1,2,3,4)(tag)
It's doable, but a lot of work for little reward. I'm leaning towards your idea, cnt. Do you think this would ever be used, though? Or would my work be all for naught? |
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 27 Mar 2015 10:25 PM |
| Why not use a form of lua since that's what ROBLOX uses anyway? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 27 Mar 2015 10:26 PM |
So to match: "create 'type' in 'location'" %s*create%s+(%b'')%s*in%s*(%b'')
Or something, up to you. |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 10:28 PM |
Where's the fun in that, Klink? I'm thinking something like this:
new ScreenGui in game.StarterGui set Name "Gui"
new Frame in $-1 set Name "FrameThing"
new Frame in $-2 set Name "OtherFrameThing"
new Script in $-3 set Source "print('Hi!')" |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 10:46 PM |
I'm going to swallow my pride and ask for... uh, you know.. the "h" word. What's the most efficient way to do this? For loop with string.gmatch? |
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 27 Mar 2015 10:51 PM |
| Idk, a loop might not be the best way. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
kert109
|
  |
| Joined: 31 Dec 2009 |
| Total Posts: 681 |
|
| |
|
| |
|
| |
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 27 Mar 2015 11:02 PM |
| As I said, a loop is likely not the best way. |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 11:03 PM |
| Then DO provide another solution, my boy! |
|
|
| Report Abuse |
|
|