Skip to content
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

Canvas not rendering anything #7

Open
dosier opened this issue Jun 17, 2023 · 5 comments
Open

Canvas not rendering anything #7

dosier opened this issue Jun 17, 2023 · 5 comments

Comments

@dosier
Copy link

dosier commented Jun 17, 2023

Hey, first of all, thanks for putting in the work. I've been hoping for this mapping, and would like to contribute.

I am trying out one of the examples given in the project, but nothing is being drawn to the screen.

The canvas is created, and I can see the components on the screen through PixiJS debug tools in Chrome, but the rendering loop is not being started.

When I try to manually call app.render() after creating the app, it does draw the background color, if I then try to add a sprite and call app.render() again, it gives me

BatchSystem.ts:45 Uncaught TypeError: Cannot read properties of undefined (reading 'start')
    at BatchSystem.setObjectRenderer (BatchSystem.ts:45:30)
    at Sprite._render (Sprite.ts:369:24)
    at Container.render (Container.ts:643:18)
    at Container.render (Container.ts:647:34)
    at Renderer.render (Renderer.ts:511:23)
    at Application.render (Application.ts:133:23)
    at start (App.kt:69:9)
    at l (App.kt:47:47)
    at Signal.dispatch (Signal.ts:138:22)
    at Loader._onComplete (Loader.ts:548:25)

I suspect it has something to do with the ticker plugin not being loaded because when I invoke app.start() it tells me start is undefined.

Any clues?

@SirAlador
Copy link

I recently tried to do the examples and encountered similar issues. It appears that none of pixi's plugins are getting loaded automatically. Issues on the official pixi repo say that this is a webpack related issue, but most of the time this results from version mismatches between PIXI libraries which is not the case here. ¯\_(ツ)_/¯

I can't help with the ticker, but if you want to get manual rendering up and running, I got mine working by putting the following lines before I initialize my Application:

	val renderer = Renderer
	renderer.registerPlugin("batch", BatchRenderer.unsafeCast<IRendererPluginConstructor>())

@Ayfri
Copy link
Owner

Ayfri commented Aug 9, 2023

Hi, I replied to @dosier on Slack, but maybe the response was lost :)
Try and see the code of my 2D Minecraft game using PIXI-Kotlin, it was working perfectly when I was working on it (around Chrome 100-105 on Windows).

@Deorigami
Copy link

@Ayfri please update to v7

@Ayfri
Copy link
Owner

Ayfri commented Sep 25, 2023

Sorry I don't have time anymore to work on this project, I also tried on my computer to create one module per JS module, but it's not working as optional dependencies isn't a concept present in Gradle.

@Ayfri
Copy link
Owner

Ayfri commented Sep 25, 2023

I've just found out about the release of pixi 8.0.0-beta and maybe I will update this project as everything was moved into a single module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants