Groups
Groups
Sign in
Groups
Groups
Crafty
Conversations
About
Send feedback
Help
Craftyjs in React?
83 views
Skip to first unread message
Ahmed Gaber
unread,
Aug 21, 2019, 12:21:09 PM
8/21/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Crafty
Hello! I am trying to use Craftyjs in React, but am getting errors. If anyone can help that would be amazing. Thank you!
Matthijs Groen
unread,
Jun 29, 2020, 5:43:07 PM
6/29/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Crafty
I mount crafty on a div, and control it from there.
I don't use react for the game itself, but I do use it for editing tools around the game.
Relevant pieces of code:
https://github.com/speedlazer/speedlazer/blob/master/src/editor/modules/entities/EntityPreview.js
// communicate element ref on mount:
https://github.com/speedlazer/speedlazer/blob/master/src/editor/components/Preview.js
// uses ref of mounted element to mount crafty.
https://github.com/speedlazer/speedlazer/blob/master/src/editor/lib/render-crafty.js#L52
Op woensdag 21 augustus 2019 18:21:09 UTC+2 schreef Ahmed Gaber:
Reply all
Reply to author
Forward
0 new messages