Round image frame support
This commit is contained in:
parent
c2d4bcbc28
commit
cb5c0c379b
2 changed files with 32 additions and 1 deletions
|
|
@ -29,7 +29,8 @@ local store = require "store"; ---@module src.store
|
||||||
--local style = require("style");
|
--local style = require("style");
|
||||||
local class = require "class"; ---@module src.class
|
local class = require "class"; ---@module src.class
|
||||||
local mount = require "mount"; ---@module src.mount
|
local mount = require "mount"; ---@module src.mount
|
||||||
local _,advancedTween = pcall(require,"src.libs.AdvancedTween"); ---@module src.libs.AdvancedTween
|
local _,advancedTween = pcall(require,"libs.AdvancedTween"); ---@module src.libs.AdvancedTween
|
||||||
|
local _,round = pcall(require,"libs.round"); ---@module src.libs.round
|
||||||
|
|
||||||
local idSpace = {};
|
local idSpace = {};
|
||||||
function module.init(id)
|
function module.init(id)
|
||||||
|
|
@ -42,6 +43,7 @@ function module.init(id)
|
||||||
local this = {items = {}};
|
local this = {items = {}};
|
||||||
|
|
||||||
this.require = require;
|
this.require = require;
|
||||||
|
this.round = type(round) == "table" and round;
|
||||||
this.advancedTween = type(advancedTween) == "table" and advancedTween;
|
this.advancedTween = type(advancedTween) == "table" and advancedTween;
|
||||||
this.event = event.init(this);
|
this.event = event.init(this);
|
||||||
this.store = store.init(this);
|
this.store = store.init(this);
|
||||||
|
|
|
||||||
29
src/libs/round.lua
Normal file
29
src/libs/round.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
local round = {};
|
||||||
|
|
||||||
|
local outlineImage = "http://www.roblox.com/asset/?id=4668565547";
|
||||||
|
local outlineScaleType = Enum.ScaleType.Slice;
|
||||||
|
local outlineSliceCenter = Rect.new(Vector2.new(516,516),Vector2.new(516,516));
|
||||||
|
local outlineSliceScale = 0.00208;
|
||||||
|
|
||||||
|
local roundImage = "http://www.roblox.com/asset/?id=4668069300";
|
||||||
|
local roundScaleType = Enum.ScaleType.Slice;
|
||||||
|
local roundSliceCenter = Rect.new(Vector2.new(516,516),Vector2.new(516,516));
|
||||||
|
local roundSliceScale = 0.0019166666666667;
|
||||||
|
|
||||||
|
function round:setRound(ImageFrame,RoundSize)
|
||||||
|
ImageFrame.Image = roundImage;
|
||||||
|
ImageFrame.ScaleType = roundScaleType;
|
||||||
|
ImageFrame.SliceCenter = roundSliceCenter;
|
||||||
|
ImageFrame.SliceScale = roundSliceScale * RoundSize;
|
||||||
|
return ImageFrame;
|
||||||
|
end
|
||||||
|
function round:setOutline(ImageFrame,RoundSize)
|
||||||
|
ImageFrame.Image = outlineImage
|
||||||
|
ImageFrame.ScaleType = outlineScaleType;
|
||||||
|
ImageFrame.SliceCenter = outlineSliceCenter;
|
||||||
|
ImageFrame.SliceScale = outlineSliceScale * RoundSize;
|
||||||
|
return ImageFrame;
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
return round;
|
||||||
Loading…
Reference in a new issue