question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sprite example not working, main readme example not working.

See original GitHub issue

The sprite example appears to not be fetching some dynamic libs it looking for:

~/Code/scratchwork/deno_sdl2/examples/sprite  deno run --unstable --allow-read --allow-net --allow-run --allow-env --allow-write  main.ts
Download target/debug/libdeno_sdl2.dylib
error: Uncaught (in promise) CacheError: /Users/andrew/Code/scratchwork/deno_sdl2/examples/sprite/target/debug/libdeno_sdl2.dylib is not valid.
    throw new CacheError(`${path} is not valid.`);
          ^
    at protocolFile (https://deno.land/x/cache@0.2.13/file_fetcher.ts:12:11)
    at async fetchFile (https://deno.land/x/cache@0.2.13/file_fetcher.ts:41:14)
    at async FileWrapper.fetch (https://deno.land/x/cache@0.2.13/file.ts:95:18)
    at async FileWrapper.get (https://deno.land/x/cache@0.2.13/file.ts:113:12)
    at async cache (https://deno.land/x/cache@0.2.13/cache.ts:67:10)
    at async Wrapper.cache (https://deno.land/x/cache@0.2.13/cache.ts:21:12)
    at async Module.prepare (https://deno.land/x/plug@0.4.0/plug.ts:75:16)
    at async file:///Users/andrew/Code/scratchwork/deno_sdl2/bindings/bindings.ts:11:14

it also is missing a few permissions in the readme (--allow-env --allow-write)

the main readme example has some incorrect type errors:

~/Code/scratchwork/deno_sdl2  deno run --unstable sample.ts
Check file:///Users/andrew/Code/scratchwork/deno_sdl2/sample.ts
error: TS2345 [ERROR]: Argument of type '{ title: string; width: number; height: number; }' is not assignable to parameter of type 'WindowOptions'.
  Type '{ title: string; width: number; height: number; }' is missing the following properties from type 'WindowOptions': flags, centered, fullscreen, hidden, and 3 more.
const canvas = new Canvas({ title: "Hello, Deno!", width: 800, height: 400 });
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at file:///Users/andrew/Code/scratchwork/deno_sdl2/sample.ts:3:27

it is also missing the --unstable flag

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
andykaiscommented, Dec 9, 2021

Ooo! Its working Screen Shot 2021-12-09 at 3 11 38 PM

Thanks @littledivy. It might be worth shoring up the readme with that change. Also the examples readme isnt quite accurate either (e.g. deno run --unstable -A main.ts from the examples/sprite folder doesnt work, but deno run --unstable -A examples/sprite/main.ts from the main folder does work).

Feel free to close this issue since my problem is solved, but it just might be worth fixing the readme before closing it

1reaction
littledivycommented, Dec 9, 2021

@andykais I think something changed recently with Cargo features naming. _ in feature names do not map to -'s anymore. This should work: deno_bindgen -- --features "use-vcpkg"

Read more comments on GitHub >

github_iconTop Results From Across the Web

sprites/README.md at main · playcanvas/sprites
Launch the application. Buttons. You can attach an event handler for each sprite for the 'click' event. For example add this script on...
Read more >
Untitled
This sprite engine prototype is modeled after Facebook's JSGameBench ... The only major remaining problem is how to avoid the per-sprite texture bind....
Read more >
How can I test what my readme.md file will look like before ...
I'm curious to see whether being hosted by GitHub would sidestep the GitHub API request limit, and whether I run afoul of cross-domain...
Read more >
[Released]Pixel Perfect Camera
It's a camera script which gives more control over the camera size and enables pixel perfect rendering for pixel art sprites. Features
Read more >
PIXI v1.32 - Sprite Insertion Tool
(Atari2.0) Fixed snestopc not working correctly on SA-1 roms bigger ... statements for states that are not 8, more details in README.txt
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found