Discord
Login
Community
DARK THEME

Brython + PIXI.js

Hello everyone! i already made up this question but nobody no one was able to help me (or to answer lol)

what i write in javascript is this:

c = new PIXI.Container()
s = PIXI.Sprite.from('icon')
c.addChild(s)

and all this work.. but when i try this in python:

c = PIXI.Container.new()
s = PIXI.Sprite.from('icon') # tb_frame
c.addChild(s)

give me an error.. javascript is not very confortable to me like other languages so i searched a solution for this problem online and what i finded is https://jsfiddle.net/s7butdL1/30/ here the programmer uses JSConstructor to made up his PIXI objects so, i tried importing the same library as them does but it is undefined so my question is: is there a way to use PIXI.Sprite in Python in microStudio? is it an error of mine or is something missing? is there a way to use JSConstructor and how should i do that? GILLES i really need an answear of yours, i'm getting crazy

Thanks to everyone that will try.

thanks to Gilles, now we know how to!

s = PIXI.Sprite['from']('icon')

from is a keyword in python.. just use this instead

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community