diff options
| author | Ray <raysan5@gmail.com> | 2016-08-07 10:46:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-07 10:46:03 +0200 |
| commit | 46248b0922846e4beb386c5cf8fc12ebd3219b72 (patch) | |
| tree | 626f274af1edf2ccdbdb7fe2d307c96491dbc02f /examples | |
| parent | 306945fe147ea7742880635e77a5c2656f6e1fdc (diff) | |
| parent | 47b6e627449187f5385e9beafeda3b8517faae26 (diff) | |
| download | raylib-46248b0922846e4beb386c5cf8fc12ebd3219b72.tar.gz raylib-46248b0922846e4beb386c5cf8fc12ebd3219b72.zip | |
Merge pull request #175 from ghassanpl/develop
More fixes for Lua
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/core_drop_files.lua | 9 | ||||
| -rw-r--r-- | examples/shaders_custom_uniform.lua | 6 |
2 files changed, 9 insertions, 6 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) diff --git a/examples/shaders_custom_uniform.lua b/examples/shaders_custom_uniform.lua index fb93adc1..3a8bbae5 100644 --- a/examples/shaders_custom_uniform.lua +++ b/examples/shaders_custom_uniform.lua @@ -60,11 +60,11 @@ while not WindowShouldClose() do -- Detect window close button or ESC key --------------------------------------------------------------------------------------- local mousePosition = GetMousePosition() - swirlCenter[0] = mousePosition.x - swirlCenter[1] = screenHeight - mousePosition.y + swirlCenter[1] = mousePosition.x + swirlCenter[2] = screenHeight - mousePosition.y -- Send new value to the shader to be used on drawing - SetShaderValue(shader, swirlCenterLoc, swirlCenter, 2) + SetShaderValue(shader, swirlCenterLoc, swirlCenter) camera = UpdateCamera(camera) -- Update internal camera and our camera --------------------------------------------------------------------------------------- |
