Hello world!

These examples assumes that you've successfully installed Enoria into game.ReplicatedStorage , and that you have created a project!

Go into your Main LocalScriptinsert the following code:

local Enoria = require(game.ReplicatedStorage.Enoria.Enoria) -- importing Enoria core model

local e = Enoria.new() -- creating the Enoria core object

e:RunApp({
	Name = "MyApp",
	Home = e.TextLabel("Hello world")
})

Here are the explanations to what we are doing:

  1. We begin by importing what modules we need, in this example we just need the Enoria model.

  2. Then, we initialize the model.

  3. We run the app with different paramters (GUI name and home widget).

  4. We're only inserting a TextLabel with the text "Hello world!".

Run the game just to see if everything seems to work:

Then, we want to center it in a white frame. And maybe change the font size!

...
e:RunApp({
		Name = appName,
		Home = e.Container({ -- a Container is like a Frame
			Child = e.TextLabel("Hello world!", {
				Centered = true, -- automatically centers the text
				TextSize = 32 -- just like you would do with a normal TextLabel!
			})
		})
})

When you run the game, you should see a white Frame with a TextLabel that is displaying "Hello World!" !

Last updated