aboutsummaryrefslogtreecommitdiff
path: root/examples/core_drop_files.lua
diff options
context:
space:
mode:
authorghassanpl <kronikarz@gmail.com>2016-08-06 21:51:08 +0200
committerghassanpl <kronikarz@gmail.com>2016-08-06 21:51:08 +0200
commit6f27941e286eba9872d1c341b446c9d13272405a (patch)
tree276258e9f56c444122cdff06a8cfebcc6b49f605 /examples/core_drop_files.lua
parent1950085893f16d653f16ec0a0c991678e8c3cf53 (diff)
downloadraylib-6f27941e286eba9872d1c341b446c9d13272405a.tar.gz
raylib-6f27941e286eba9872d1c341b446c9d13272405a.zip
GetDroppedFiles and SetShaderValue in Lua working
Exposed Texture2D.id to Lua Lights now have settable/gettable fields
Diffstat (limited to 'examples/core_drop_files.lua')
-rw-r--r--examples/core_drop_files.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/core_drop_files.lua b/examples/core_drop_files.lua
index 0a437422..99ab4325 100644
--- a/examples/core_drop_files.lua
+++ b/examples/core_drop_files.lua
@@ -28,7 +28,10 @@ SetTargetFPS(60)
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
- if (IsFileDropped()) then droppedFiles = GetDroppedFiles(count) end
+ if (IsFileDropped()) then
+ droppedFiles = GetDroppedFiles()
+ count = #droppedFiles
+ end
---------------------------------------------------------------------------------------
-- Draw
@@ -41,11 +44,11 @@ while not WindowShouldClose() do -- Detect window close button or ESC key
else
DrawText("Dropped files:", 100, 40, 20, DARKGRAY)
- for i = 0, count do
+ for i = 0, count-1 do
if (i%2 == 0) then DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.5))
else DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.3)) end
- DrawText(droppedFiles[i], 120, 100 + 40*i, 10, GRAY)
+ DrawText(droppedFiles[i+1], 120, 100 + 40*i, 10, GRAY)
end
DrawText("Drop new files...", 100, 110 + 40*count, 20, DARKGRAY)