Jump to content

Editor Crashing with HTML elements


Wolfsbane
 Share

Recommended Posts

Hi Team,

I'm doing something a little bit different in Panda. I'm trying to create a mix of canvas and standard HTML elements. E.g. screenshot:

image.png.c8fba33da412d1c635f72c5bfa7e2773.png

 

So when you hit certain buttons, we'll call some functions from our scene, so we can see what happens. (e.g. game.system.scene.functionName()).

Now: Things that don't work in Panda.

The Attack Unit input box: I'm using html select:

<select id = "AttackUnit">
            <option value="Soldier">Soldier</option>
            <option value="Alpha Warrior">Alpha Warrior</option>
            <option value="Elf">Elf</option>
            <option value="M-31">M-31</option>
        </select>

If you click on the element within the PandaEditor, Panda crashes.

 

For the Defending unit input box, I tried using an input box with a datalist. e.g. something like this.

<input list="DefendUnits" id="DefendUnit"> </br>
<datalist id="DefendUnits">
     <option value="Soldier">
     <option value="Alpha Warrior">
</datalist>

<input id="Create Defending Unit" type="button" value="Create Defending Unit" 
                onclick="game.system.scene.createDefendingUnit(document.getElementById('DefendUnit').value);" />

This won't work in the Panda Editor. It doesn't crash, but it only ever passes an empty string. I *have* to type the name for it to work.

If I just use an ordinary input type, and just type in my Unit name, it will work in the Panda Editor.

All options work great if I just open it in Chrome. Edit: Also: Works fine in PandaRemote, too, on my phone.

Any thoughts on this? Should I just simply assume that I shouldn't be trying to make non-html elements in the PandaEditor?

 

 

Link to comment
Share on other sites

@Wolfsbane

If your width is larger than height, then your game will be considered as landscape. So you have to turn your device with Panda Remote into landscape and your game should show up fine.

If you want to disable that feature you can do it by setting rotateScreen attribute on System to false.

game.config = {
    system: {
        rotateScreen: false
    }
};

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...