Compare commits

...

2 Commits

Author SHA1 Message Date
Jay b30fbca745 absolute pixel values for sidebar, topbar 2020-05-03 21:57:24 +01:00
Jay 448fb6e37b Fix old use of 0.19 APIs in workshop files 2020-05-03 21:39:26 +01:00
4 changed files with 46 additions and 48 deletions

View File

@ -53,10 +53,10 @@ return {
size = guiCoord(0.95, 0, 0.4, 0),
position = guiCoord(0.025, 0, 0.23, 0),
backgroundColour = globals.defaultColours.white,
borderAlpha = 1,
borderRadius = 5,
borderWidth = 3,
borderColour = globals.defaultColours.secondary
strokeAlpha = 1,
strokeRadius = 5,
strokeWidth = 3,
strokeColour = globals.defaultColours.secondary
})
teverse.construct("guiIcon", {
@ -74,7 +74,7 @@ return {
size = guiCoord(0.82, 0, 1, 0),
position = guiCoord(0.15, 0, 0, 0),
text = text,
fontSize = 16,
textSize = 16,
textColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white,
textAlign = enums.align.middle,
@ -111,17 +111,17 @@ return {
size = guiCoord(0.8, 0, 0.9, 0),
position = guiCoord(0.133, 0, 0.05, 0),
backgroundColour = globals.defaultColours.white,
borderAlpha = 1,
borderRadius = 5,
borderWidth = 3,
borderColour = globals.defaultColours.primary
strokeAlpha = 1,
strokeRadius = 5,
strokeWidth = 3,
strokeColour = globals.defaultColours.primary
})
teverse.construct("guiIcon", {
parent = bodyContainer,
size = guiCoord(0, 16, 0, 16),
position = guiCoord(0.05, 0, 0.3, 0),
iconId = "fa:s-info-circle",
iconId = "info-circle",
iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white,
@ -132,7 +132,7 @@ return {
size = guiCoord(0.82, 0, 1, 0),
position = guiCoord(0.15, 0, 0, 0),
text = text,
fontSize = 16,
textSize = 16,
textColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white,
textAlign = enums.align.middle,

View File

@ -24,29 +24,29 @@ return {
teverse.construct("guiFrame", {
parent = teverse.interface,
size = guiCoord(0.04, 0, 0.015, 0),
position = guiCoord(0, 0, 0.05, 0),
size = guiCoord(0, 40, 0, 10),
position = guiCoord(0, 0, 0, 40),
backgroundColour = globals.defaultColours.secondary,
})
teverse.construct("guiFrame", {
parent = teverse.interface,
size = guiCoord(0.04, 0, 0.015, 0),
position = guiCoord(0, 0, 0.24, 0),
size = guiCoord(0, 40, 0, 10),
position = guiCoord(0, 0, 0, 180),
backgroundColour = globals.defaultColours.secondary,
})
local toolsContainer = teverse.construct("guiFrame", {
parent = teverse.interface,
size = guiCoord(0.04, 0, 0.18, 0),
position = guiCoord(0, 0, 0.065, 0),
size = guiCoord(0, 40, 0, 130),
position = guiCoord(0, 0, 0, 50),
backgroundColour = globals.defaultColours.white,
})
local selectTool = teverse.construct("guiIcon", {
parent = toolsContainer,
size = guiCoord(0, 20, 0, 20),
position = guiCoord(0.25, 0, 0.1, 0),
position = guiCoord(0.25, 0, 0, 10),
iconId = "location-arrow",
iconType = "faSolid",
iconColour = globals.defaultColours.primary,
@ -56,7 +56,7 @@ return {
local moveTool = teverse.construct("guiIcon", {
parent = toolsContainer,
size = guiCoord(0, 20, 0, 20),
position = guiCoord(0.25, 0, 0.32, 0),
position = guiCoord(0.25, 0, 0, 40),
iconId = "arrows-alt-h",
iconType = "faSolid",
iconColour = globals.defaultColours.primary,
@ -66,7 +66,7 @@ return {
local rotateTool = teverse.construct("guiIcon", {
parent = toolsContainer,
size = guiCoord(0, 20, 0, 20),
position = guiCoord(0.25, 0, 0.54, 0),
position = guiCoord(0.25, 0, 0, 70),
iconId = "sync",
iconType = "faSolid",
iconColour = globals.defaultColours.primary,
@ -76,8 +76,8 @@ return {
local sizeTool = teverse.construct("guiIcon", {
parent = toolsContainer,
size = guiCoord(0, 20, 0, 20),
position = guiCoord(0.25, 0, 0.76, 0),
iconId = "fa:s-expand",
position = guiCoord(0.25, 0, 0, 100),
iconId = "expand",
iconType = "faSolid",
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white,
@ -86,8 +86,8 @@ return {
local moreToolsContainer = teverse.construct("guiFrame", {
parent = teverse.interface,
name = "moreToolsContainer",
size = guiCoord(0.04, 0, 1, 0),
position = guiCoord(0, 0, 0.255, 0),
size = guiCoord(0, 40, 1, -190),
position = guiCoord(0, 0, 0, 190),
backgroundColour = globals.defaultColours.white,
})
@ -146,7 +146,7 @@ return {
parent = page,
name = name,
size = guiCoord(0, 20, 0, 20),
position = guiCoord((0.25+xPositionOverride), 0, 0.02+(#page.children*0.04), 0), -- Shorthand positioning w/o a for-loop
position = guiCoord((0.25+xPositionOverride), 0, 0, 10 + (#page.children*30)), -- Shorthand positioning w/o a for-loop
iconId = icon,
iconType = "faSolid",
iconColour = globals.defaultColours.primary,
@ -158,12 +158,12 @@ return {
--button:mouseLeftPressed(callback) -- When button is clicked, perform callback action
-- When mouse hovers over button, display tooltip
iconImage:on("mouseFocused", function()
iconImage:on("mouseEnter", function()
_tooltip.display()
end)
-- When mouse leaves from button, hide tooltip
iconImage:on("mouseUnfocused", function()
iconImage:on("mouseExit", function()
_tooltip.hide()
end)
end

View File

@ -28,7 +28,7 @@ return {
local container = teverse.construct("guiFrame", {
parent = teverse.interface,
size = guiCoord(1, 0, 0.05, 0),
size = guiCoord(1, 0, 0, 40),
position = guiCoord(0, 0, 0, 0),
backgroundColour = globals.defaultColours.white,
})
@ -50,19 +50,17 @@ return {
position = guiCoord(0.04, 0, 0.05, 0),
text = titleValue,
textColour = globals.defaultColours.primary,
fontFile = "local:OpenSans-Bold.ttf",
fontSize = 30,
readOnly = true
textFont = "tevurl:fonts/openSansBold.ttf",
textSize = 30
})
teverse.construct("guiTextBox", {
parent = container,
size = guiCoord(0.48, 0, 0.1, 0),
position = guiCoord(0.86, 0, 0.1, 0),
text = globals.user[2],
text = globals.user.name,
textColour = globals.defaultColours.primary,
fontSize = 25,
readOnly = true
textSize = 25
})
local userIcon = teverse.construct("guiFrame", {
@ -70,7 +68,7 @@ return {
size = guiCoord(0, 32, 0, 32),
position = guiCoord(0.82, 0, 0, 0),
backgroundColour = globals.defaultColours.primary,
borderRadius = 100
strokeRadius = 100
})
local statusIcon = teverse.construct("guiFrame", {
@ -78,10 +76,10 @@ return {
size = guiCoord(0, 16, 0, 16),
position = guiCoord(0.836, 0, 0.5, 0),
backgroundColour = globals.defaultColours.green,
borderWidth = 2,
borderColour = globals.defaultColours.white,
borderAlpha = 1,
borderRadius = 32,
strokeWidth = 2,
strokeColour = globals.defaultColours.white,
strokeAlpha = 1,
strokeRadius = 32,
zIndex = 100
})
@ -114,7 +112,7 @@ return {
iconColour = globals.defaultColours.primary,
backgroundColour = globals.defaultColours.white,
})
local test = self
self.register = function(name, tooltip, page)
--[[
@Description
@ -129,21 +127,21 @@ return {
Void, null, nil
]]--
table.insert(self.keys, {name})
local button = teverse.construct("guiButton", {
table.insert(test.keys, {name})
local button = teverse.construct("guiTextBox", {
parent = container,
size = guiCoord(0.056, 0, 0.9, 0),
position = guiCoord(0.2+(#self.keys*0.07), 0, 0.05, 0),
position = guiCoord(0.2+(#test.keys*0.07), 0, 0.05, 0),
text = name,
textColour = globals.defaultColours.primary,
fontSize = 30,
textSize = 22,
textAlign = enums.align.middle,
zIndex = 100
})
local _tooltip = toolTip.construct("vertical", button, tooltip) -- Initialize tooltip instance
button:mouseLeftPressed(function()
button:on("mouseLeftDown", function()
globals.sideBarPageActive.visible = (not globals.sideBarPageActive.visible) -- Unlist active page from view
if globals.sideBarPageActive == page then -- If the same page is clicked twice, unlist and replace with default page
globals.sideBarPageActive = globals.sideBarPageDefault
@ -155,12 +153,12 @@ return {
end)
-- When mouse hovers over button, display tooltip
button:on("mouseFocused", function()
button:on("mouseEnter", function()
_tooltip.display()
end)
-- When mouse leaves from button, hide tooltip
button:on("mouseUnfocused", function()
button:on("mouseExit", function()
_tooltip.hide()
end)
end

View File

@ -44,7 +44,7 @@ local testPage = sideBar.registerPage("Test") -- Register test page to sidebar i
sideBar.registerIcon(testPage, "consoleIcon", "terminal", " Open console window", nil)
sideBar.registerIcon(testPage, "playIcon", "play", "Play scene", nil)
sideBar.registerIcon(testPage, "serverIcon", "server", "Configure server", nil)
sideBar.registerIcon(testPage, "fullScreenIcon", "fullscreen", "Toggle full screen", nil)
sideBar.registerIcon(testPage, "fullScreenIcon", "expand-alt", "Toggle full screen", nil)