-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
: bad argument #2 to 'windowUpdateMode' (number expected, got nil) #30
Comments
how can i correct this error |
Hello @ShubhamKumbhar, could you give me some more details so I can try to reproduce the issue? |
Sir, I'm using push library in my project ..and i copied the code push.lua provided by you in push.lua file and when i run the program this error is expected |
main.lua push = require 'push' Window_Width =1280 Virtual_Width=432 function love.load() love.graphics.setDefaultFilter('nearest','nearest') push:setupScreen(Virtual_Width,Virtual_Height,Window_Width,Window_Heigh, { end function love.keypressed(key) function love.draw() push:apply('start') love.graphics.printf('Hello Pong' , 0 ,Virtual_Height/2-6,Virtual_Width,'center') push:apply('end') push.lua: -- Copyright (c) 2020 Ulysse Ramage local love11 = love.getVersion() == 11 local push = { defaults = { } function push:applySettings(settings) function push:resetSettings() return self:applySettings(self.defaults) end function push:setupScreen(WWIDTH, WHEIGHT, RWIDTH, RHEIGHT, settings) settings = settings or {} self._WWIDTH, self._WHEIGHT = WWIDTH, WHEIGHT self:applySettings(self.defaults) --set defaults first windowUpdateMode(self._RWIDTH, self._RHEIGHT, { self:initValues() if self._canvas then self._borderColor = {0, 0, 0} self._drawFunctions = { return self function push:setupCanvas(canvases) self._canvas = true for i = 1, #canvases do return self function push:setCanvas(name) function push:initValues() self._SCALE = { if self._stretched then --if stretched, no need to apply offset
end self._GWIDTH = self._RWIDTH * self._PSCALE - self._OFFSET.x * 2 function push:apply(operation, shader) function push:start() else function push:applyShaders(canvas, shaders)
end function push:finish(shader)
else function push:setBorderColor(color, g, b) function push:toGame(x, y) x = (x >= 0 and x <= self._WWIDTH * self._SCALE.x) and normalX * self._WWIDTH or nil return x, y --doesn't work - TODO function push:switchFullscreen(winw, winh) if self._fullscreen then --save windowed dimensions for later self._RWIDTH = self._fullscreen and windowWidth or winw or self._WINWIDTH self:initValues() love.window.setFullscreen(self._fullscreen, "desktop") function push:resize(w, h) function push:getWidth() return self._WWIDTH end return push Error push.lua:48: bad argument #2 to 'windowUpdateMode' (number expected, got nil) Traceback [C]: in function 'windowUpdateMode' |
Thanks! By the way, you can paste blocks of code using
By looking at your code, it seems you might have made a typo when calling push:setupScreen() with "Window_Heigh" instead of "Window_Height"? Could you try this and let me know :-) |
Ok sir
…On Mon, Apr 13, 2020, 10:38 PM Ulydev ***@***.***> wrote:
Thanks! By the way, you can paste blocks of code using
```lua
-- code here
```
By looking at your code, it seems you might have made a typo when calling
push:setupScreen() with "Window_Heigh" instead of "Window_Height"? Could
you try this and let me know :-)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#30 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/APFFPDQ536JBDBXOQDILZ6TRMNBJBANCNFSM4MG6IYRQ>
.
|
Thank you sir...It worked..
I did such a silly mistake 😅
On Mon, Apr 13, 2020, 10:40 PM Shubham Kumbhar <kumbharshubham811@gmail.com>
wrote:
… Ok sir
On Mon, Apr 13, 2020, 10:38 PM Ulydev ***@***.***> wrote:
> Thanks! By the way, you can paste blocks of code using
>
> ```lua
> -- code here
> ```
>
> By looking at your code, it seems you might have made a typo when calling
> push:setupScreen() with "Window_Heigh" instead of "Window_Height"? Could
> you try this and let me know :-)
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#30 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/APFFPDQ536JBDBXOQDILZ6TRMNBJBANCNFSM4MG6IYRQ>
> .
>
|
Glad it worked! Sometimes you just need a helping hand to find typos, there's nothing to worry about :-) |
Error
push.lua:48: bad argument #2 to 'windowUpdateMode' (number expected, got nil)
Traceback
[C]: in function 'windowUpdateMode'
push.lua:48: in function 'setupScreen'
main.lua:14: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
The text was updated successfully, but these errors were encountered: