nico icon indicating copy to clipboard operation
nico copied to clipboard

`nico.nim(2227, 19) Error: type mismatch: got '(int, int, int32, int32)' for '(int(x), int(y), src.w * scale, src.h * scale)' but expected 'Rect = tuple[x: int, y: int, w: int, h: int]'`

Open arkanoid87 opened this issue 2 years ago • 7 comments

choosenim stable
nimble install nico
nicoboot test test test
cd test
nimble webd

arkanoid87 avatar Aug 25 '23 21:08 arkanoid87

nim 1.6.14 + rund = works nim 1.6.14 + webd = works nim 2.0.0 + rund = works nim 2.0.0 + webd = error

arkanoid87 avatar Aug 25 '23 23:08 arkanoid87

Have the same problem with Nim2.0

HVukman avatar Aug 31 '23 11:08 HVukman

Fix it

let dst: Rect = (x.int, y.int, src.w * scale.int, src.h * scale.int)

Angluca avatar Dec 30 '23 19:12 Angluca

Can build now with webr on Ubuntu, but I cannot run it in the browser (this is the basic example):

registerOrRemoveHandler: the target element for event handler registration does not exist, when processing the following event handler registration:Object allowsDeferredCalls: true callbackfunc: 609 eventTypeString: "touchstart" handlerFunc: e=> {…} target: null useCapture: 0 [[Prototype]]: Object

and then:

Aborted(Runtime error: The application has corrupted its heap memory area (address zero)!) abort @ niconim.js:1 Uncaught RuntimeError: Aborted(Runtime error: The application has corrupted its heap memory area (address zero)!) at abort (niconim.js:1:20947) at checkStackCookie (niconim.js:1:17381) at handleException (niconim.js:1:99085) at callUserCallback (niconim.js:1:118954) at Object.runIter (niconim.js:1:129885) at Browser_mainLoop_runner (niconim.js:1:128289)

HVukman avatar Jan 07 '24 17:01 HVukman

@HVukman Sorry I haven't use nico in linux so don't know .

But you can test it.

  1. Install sdl2 and emscripten
  2. Use this nimble (nimble webr and runweb) or bash input command test https://github.com/Angluca/nico/blob/main/exampleApp/exampleApp.nimble
nim c -d:emscripten -o:exampleApp.html src/main.nim
emrun exampleApp.html

Angluca avatar Jan 08 '24 08:01 Angluca

^ This works under WIndows, thanks. Edit: if anybody stumbles upon this and uploads their game on itch.io: You need to enable SharedBufferSupport https://itch.io/t/2025776/experimental-sharedarraybuffer-support

HVukman avatar Jan 08 '24 11:01 HVukman

@HVukman Doesn't work for me on windows :( image

ayyfte avatar Jul 24 '24 15:07 ayyfte