Closed cmhoopla closed 2 months ago
But, I've just found that I can load the plugin scripts in a preload... so I've got a work around :)
Also, whilst I was looking into this, it seems that rexbbcodetextplugin has Phaser bundled in with it... is that correct? It would seem to me that having loaded the phaser js I'm reloading it with the plug in?
I use webpack in my test environment, it works fine.
After import Phaser, it will add phaser at reference window.Phaser
, then my plugin can use Phaser.GameObjects.GameObject to create a GameObject class.
rexbbcodetextplugin does not have (full) Phaser bundled, the rendering logic of bbcodetext is copy&modify from phaser engine.
Thanks @rexrainbow I did suspect it was me doing something wrong... I've just tried again, and it seems if I add the import (in my index.js) import BBCodeTextPlugin from 'phaser3-rex-plugins/plugins/bbcodetext-plugin.js';
but don't add the rexBBCodeTextPlugin the edit text works as expected... is that how you'd expect to set it up?
A test code of bbcodetext, The path is 'phaser3-rex-plugins/plugins/bbcodetext-plugin.js'
as you expect.
Then add it into game config
(I'm working in a different machine now) Thanks for getting back to me... And also, thanks for the clarification about the rexbbcodetextplugin. I'm still not able to get the imports to work - I've made a basic repo if you've time or inclination to take a look https://github.com/charlie-says/rextest
var txt = scene.rexUI.add.BBCodeText(x, y, text, style)
for example. ref. And text-edit is also included in rexUI.
Moreover, textbox element is designed for typing content on text game object (text, bbcodetext, or bitmpatext).Thanks for all your help... I have now got the imports working :) Quick question about TextEdit (or maybe BBCodeText) If I set the padding property of the text it works as expected, but, as soon as I edit, the text doesn't respect the padding, and jumps to the edge. Is that resolvable? I've pushed that change to the above repo if you want to see it in action.
Bug fixed, now padding left, padding right can bypass to input text dom. NPM package will upgrade at end of this month.
I'm trying to use the Rex UI plugin, I'm using phaser 3.80.1 & Rex 1.80.2
I'm just trying to replicate this pen: https://codepen.io/rexrainbow/pen/dyezeQN
but in the phaser webpack build.
Importing the TextEditPlugin works ok.
import BBCodeTextPlugin
doesn't cause an error, but, as soon as you add it to the config: { key: 'rexBBCodeTextPlugin', plugin: BBCodeTextPlugin, start: true },
you get the following error: bbcodetext-plugin.js:20 Uncaught TypeError: pluginManager.registerGameObject is not a function