-
Notifications
You must be signed in to change notification settings - Fork 64
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
No text displaying in a-gui-input's #43
Comments
Either of you ever figure this out? @sulaemansantoso @DaryllConway |
It isn't documented in the readme as far as I can tell, but looking into the example code, it's pretty straightforward: <a-gui-flex-container
id="startup-menu555"
flex-direction="column"
justify-content="center"
align-items="normal"
component-padding="0.1"
opacity="0.7" width="4" height="5"
position="-6 1.5 -8"
rotation="0 -90 0"
>
<a-gui-input
id="test_input555"
width="3" height="0.7"
onclick="alert('hi')"
value="Starting value"
font-size="160px"
font-color="red"
border-color="#212121"
border-hover-color="#424242"
background-color="#FAFAFA"
hover-color="#F5F5F5"
margin=".15 0 0 0"
active-color="#FFEB3B"
>
</a-gui-input>
</a-gui-flex-container> var textField = document.querySelector("a-gui-input");
textField.components['gui-input'].appendText('adding text');
setTimeout(() => {alert('will delete text now'); textField.components['gui-input'].delete();}, 10000) Note that "delete" deletes one character, not whole input. |
a little more digging in the source for gui-input shows that textField.setAttribute('gui-input', 'text', "helloooo"); works for updating the text more than one char at a time however, initial text values seem broken to me for now--if I figure out something I'll add it here, and hopefully eventually update the docs. |
(To be clear, the 'starting value' feature does seem broken, though.) |
Yes you're right, the issue is the starting value. but i haven't tried to look more into it |
There are many small things like that. I'm grateful to this library, but it needs a second pass of polish. It feels like someone created a full library beta version and threw a ton of components at the wall, but didn't check everything everywhere. Shows great promise, just needs minor tweaks, in the meantime takes workarounds like the one I mentioned. (As in, that's right, initial text value doesn't work, but you can populate initial text right after element creation with JS instead for now.) I know there's a big update coming with some important, very nice changes. Once that lands, I'm hoping to actually take on a bunch of those small updates and documentation fixing. I've been developing my menu system in my app with this. |
#62 anyone? |
I've spent a whole day trying to get text to display in an a-gui-input but it's just constantly blank no matter what I do, can you see where I'm going wrong?
The text was updated successfully, but these errors were encountered: