Forager

Forager

Not enough ratings
UI System
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
45.497 KB
19 Dec, 2019 @ 3:32pm
1 Change Note ( view )

Subscribe to download
UI System

Description
This mod adds a simple UI system to the modding API since we don't have LUI yet :D

DOCUMENTATION

-- ENUMS --
UIAnchor
UIAlign
UIShape
UIElement
Animation

-- MAIN SCRIPTS --

CreateUI(_name: string);
DeleteUI(_name: string);
RenderUI(_uiname: string);
UpdateUI(_uiname: string);

-- ELEMENTS --

CreateUIElement(_eltype: elementtype, _elanchor: uianchor, _elparent: [undefined, element name, location, instance], _elalign: uialign, _elpadding: array [x, y], _elinteract: scriptwrap, _eldata: array);
CreateShapeElement(_anchor: uianchor, _parent: [undefined, element name, location, instance], _align: uialign, _padding: array [x, y], _shape: uishape, _size: [w, h]/w/r, _color: color, _stroke: color, _alpha: number, _interact: scriptwrap);
CreateSpriteElement(_anchor: uianchor, _parent: [undefined, element name, location, instance], _align: uialign, _padding: array [x, y], _rotation: number, _sprite: sprite, _interact: scriptwrap);
CreateTextboxElement(_anchor: uianchor, _parent: [undefined, element name, location, instance], _align: uialign, _padding: array [x, y], _text: string, _width: number, _height: number, _textcol: color, _boxData: array [useSprite, sprite/boxcolor, stroke, alpha], _interact: scriptwrap);
CreateTextElement(_anchor: uianchor, _parent: [undefined, element name, location, instance], _align: uialign, _padding: array [x, y], _rotation: number, _text: string, _textColor: color, _textSize: array [xscale, yscale], _interact: scriptwrap);

AddUIElement(_uiname: string, _elname: string, _element: element);
EditUIElement(_uiname: string, _elname: string, _prop: string, _value: any);
FindUIElement(_uiname: string, _elname: string);
RemoveUIElement(_uiname: string, _elname: string);

-- ANIMATIONS --
BounceElement(_uiname: string, _elname: string, _intensity: number, _bounces: number, _speed: number, _callback: scriptwrap);
FadeElement(_uiname: string, _elname: string, _alpha: number, _speed: number, _callback: scriptwrap);
MoveElement(_uiname: string, _elname: string, _x: number, _y: number, _sp: number, _callback: scriptwrap);
RotateElement(_uiname: string, _elname: string, _angle: number, _speed: number, _callback: scriptwrap);

-- HELPER SCRIPTS --
ApproachNumber(_value: number, _change: number, _maxvalue: number);
ApproachWrapNumber(_value: number, _target: number, _min: number, _max: number, _change: number);
CreateDSObject(_args: array [[key, value]]);
CutArray(_array: array, _value: any);
EditDSObject(_object: map, _key: primitive, _value: any);
FindDSValue(_object: map, _key: primitive);
InRange(_num: number, _min: number, _max: number);
NumberToPercent(_value: number, _maxvalue: number);
PercentToNumber(_percent: number, _maxvalue: number);
PushArray(_array: array, _value: any);
SliceArray(_array: array, _index: number);
WrapNumber(_number: number, _min: number, _max: number);
2 Comments
Yalkin 23 Jan, 2020 @ 12:05pm 
Not needed anymore
Orestesqwerty21 18 Jan, 2020 @ 7:18am 
it doesn't work