Giter Club home page Giter Club logo

neoui's Introduction

NeoUI

NeoUI is a strictly-typed Roblox Luau library making it easier to dynamically generate UI.

Also provides some utilities like default properties of gui objects being different than they normally are, for exmaple ScreenGuis have IgnoreGuiInset enabled by default, as most of the time you probably want it to be enabled. Its most useful feature is creating templates that can be used to easier make multiple UI elements that are the same/similiar, without the need to create each one individually.

Used by Tower Defense NEO (currently only in the lobby).

Usage example

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local NeoUI = require(ReplicatedStorage.NeoUI)

local PlayerGui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")

--Creating a ScreenGui and a Frame
local MainGui = NeoUI.createElement(PlayerGui, "ScreenGui", {
    Name = "MainGui"
})
local Frame = NeoUI.createElement(MainGui, "Frame", {
	Name = "MainFrame",
	BackgroundColor3 = Color3.new(1, 1, 1),
	Position = UDim2.new(0.5, 0, 0.5, 0),
	AnchorPoint = Vector2.new(0.5, 0.5),
	Size = UDim2.new(0.5, 0, 0.5, 0),
	ZIndex = 1
}, {
	UICorner = {CornerRadius = UDim.new(0, 15)},
	UIGradient = {
		Color = ColorSequence.new(Color3.new(1, 1, 1), Color3.fromRGB(136, 0, 255)),
		Rotation = 90
	}
})

--Creating TextButtons from a template
local TextTemplate = NeoUI.createTemplate("TextButton", {
	Position = UDim2.new(0.5, 0, 0.5, 0),
	AnchorPoint = Vector2.new(0, 0),
	Size = UDim2.new(0.5, 0, 0.5, 0),
	TextColor3 = Color3.new(1,1,1),
	TextStrokeTransparency = 0,
	ZIndex = 2
}, {
	UICorner = {CornerRadius = UDim.new(0.5, 0)}
})

local Button1 = NeoUI.createFromTemplate(Frame, TextTemplate, {
	Name = "Text1"
})
Button1.Activated:Connect(function()
	print("Activated Button1")
end)
local Button2 = NeoUI.createFromTemplate(Frame, TextTemplate, {
	Name = "Text2",
	AnchorPoint = Vector2.new(1,1)
})
Button2.Activated:Connect(function()
	print("Activated Button2")
end)
GUI generated by the code above

Why not React-lua?

I don't know, I just never felt like using it. Instead I decided to make a custom library specifically for my game. It's meant to be easy to use and modify, and I think I have achieved just that.

If you want something more advanced though then you'd most likely want to actually use React-lua, but still you can use NeoUI if you want an easier alternative.

neoui's People

Contributors

tenkotowsky avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.