Raygui wrapper library disable and styles for each element.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package.path = package.path..";"..RL.GetBasePath().."?.lua"
|
||||
package.path = package.path..";"..RL.GetBasePath().."../resources/lib/?.lua"
|
||||
|
||||
util = require( "utillib" )
|
||||
Util = require( "utillib" )
|
||||
Vec2 = require( "vector2" )
|
||||
Rect = require( "rectangle" )
|
||||
Color = require( "color" )
|
||||
@@ -13,29 +13,29 @@ FileExplorer = require( "file_explorer" )
|
||||
-- Textures.
|
||||
|
||||
-- Note that textures are global.
|
||||
cancelTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/cancel.png" )
|
||||
backTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/previous-button.png" )
|
||||
folderTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/open-folder.png" )
|
||||
filesTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/files.png" )
|
||||
borderTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/ui_border.png" )
|
||||
bgrTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/ui_bgr.png" )
|
||||
CancelTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/cancel.png" )
|
||||
BackTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/previous-button.png" )
|
||||
FolderTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/open-folder.png" )
|
||||
FilesTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/files.png" )
|
||||
BorderTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/ui_border.png" )
|
||||
BgrTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/ui_bgr.png" )
|
||||
|
||||
RL.GenTextureMipmaps( cancelTexture )
|
||||
RL.GenTextureMipmaps( backTexture )
|
||||
RL.GenTextureMipmaps( folderTexture )
|
||||
RL.GenTextureMipmaps( filesTexture )
|
||||
RL.GenTextureMipmaps( borderTexture )
|
||||
RL.GenTextureMipmaps( bgrTexture )
|
||||
RL.GenTextureMipmaps( CancelTexture )
|
||||
RL.GenTextureMipmaps( BackTexture )
|
||||
RL.GenTextureMipmaps( FolderTexture )
|
||||
RL.GenTextureMipmaps( FilesTexture )
|
||||
RL.GenTextureMipmaps( BorderTexture )
|
||||
RL.GenTextureMipmaps( BgrTexture )
|
||||
|
||||
RL.SetTextureFilter( cancelTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
RL.SetTextureFilter( backTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
RL.SetTextureFilter( folderTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
RL.SetTextureFilter( filesTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
RL.SetTextureFilter( borderTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
RL.SetTextureFilter( bgrTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
RL.SetTextureFilter( CancelTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
RL.SetTextureFilter( BackTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
RL.SetTextureFilter( FolderTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
RL.SetTextureFilter( FilesTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
RL.SetTextureFilter( BorderTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
RL.SetTextureFilter( BgrTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||
|
||||
RL.SetTextureWrap( borderTexture, RL.TEXTURE_WRAP_REPEAT )
|
||||
RL.SetTextureWrap( bgrTexture, RL.TEXTURE_WRAP_REPEAT )
|
||||
RL.SetTextureWrap( BorderTexture, RL.TEXTURE_WRAP_REPEAT )
|
||||
RL.SetTextureWrap( BgrTexture, RL.TEXTURE_WRAP_REPEAT )
|
||||
|
||||
-- End of calculator definition.
|
||||
|
||||
@@ -43,7 +43,7 @@ local calculator = nil
|
||||
local fileExplorer = nil
|
||||
local showButton = nil
|
||||
|
||||
function initGui()
|
||||
local function initGui()
|
||||
showButton = Gui.element:new( {
|
||||
bounds = Rect:new( 0, 0, 96, 32 ),
|
||||
drawBounds = true,
|
||||
@@ -65,7 +65,7 @@ function RL.init()
|
||||
local monitor = 0
|
||||
local mPos = RL.GetMonitorPosition( monitor )
|
||||
local mSize = RL.GetMonitorSize( monitor )
|
||||
winSize = RL.GetScreenSize()
|
||||
local winSize = RL.GetScreenSize()
|
||||
|
||||
RL.SetWindowTitle( "ReiLuaGui examples" )
|
||||
RL.SetWindowState( RL.FLAG_WINDOW_RESIZABLE )
|
||||
@@ -84,4 +84,4 @@ function RL.draw()
|
||||
RL.ClearBackground( RL.RAYWHITE )
|
||||
|
||||
Gui.draw()
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user