Dynamic text component data through JSON on A-Scene? - aframe

Hi everyone how to do it if so can you share demos or examples ...
How to do it ....
I tried many was using the text components but not able to find an exact way to do it ...

https://aframe.io/docs/0.4.0/guides/using-javascript-and-dom-apis.html
el.setAttribute('text', {text: 'Hello, World!'})
el.setAttribute('bmfont-text', {text: 'Hello, World!'})

Related

vue3 vuetifyjs v-color-picker - How to use input event

I'm new in vue3 and using v-color-picker provided by vuetify.js. My goal is that a method is executed when an input event ("new color selected") happens:
<v-color-picker
mode="hexa"
v-model="background_color"
#input="handleChangedColor"
></v-color-picker>
...
methods: {
handleChangedColor() {
console.log("New color selected")
}
},
However, the method handleChangedColor is never triggered. I would be very happy if someone could give me a hint about what I'm doing wrong!
Storing the selectedColor in the variable background_color is working correctly.
The input event is described here https://vuetifyjs.com/en/api/v-color-picker/#props
Thanks for your help.
You've linked the Vuetify 2 documentation, but since you're using Vue 3 I assume you're also using Vuetify 3. Since Vuetify 3.0 the latest documentation is now at https://next.vuetifyjs.com/en/api/v-color-picker/#events
You'll find the new v-color-picker event to listen to is update:modelValue
<v-color-picker
mode="hexa"
v-model="background_color"
#update:modelValue="handleChangedColor"
></v-color-picker>
handleChangedColor(color) {
console.log("New color selected: ", color);
}

tooltip not working in vis.js timeline

I need a tooltip for each items the problem is that when I put for example :
title:'<b>Hover over me<b></br>test'the style is not applicated and so in the tooltip the result was <b>Hover over me<b></br>test not Hover over me test.
I want to change the style of every title in the tooltip .
please have you any ideas
Without some further information, it seems you are in the correct path.
As per documentation:
title - string - "Add a title for the item, displayed when holding the mouse on the
item. The title can be an HTML element or a string containing plain
text or HTML."
Working sample below:
var data = new vis.DataSet([{
id: 2,
content: 'Pi and Mash',
start: '2014-08-08',
title: '<b> Bold title </b> <br> Not bold'
},
...
var timeline = new vis.Timeline(container, data, options);
http://jsfiddle.net/sm4r5pvc/
Update vis version. In the older version, we don't have the tooltip. Make sure you are working with v4.21.0 and above

Getting started in Kivy, need assistance with .kv files

I'm trying to make a simple app to monitor some IO And have a push button screen. I'm getting started on the framework of how the screen would work using kivy as my gui development. I'm wanting to do a lot of label updating based on variables, so the desire to do that has led me into using a .kv file and kivy properties. Admittedly, I know very little about these things it's just what I know from googling and trying to figure out what I need to do.
Regardless, I'm trying to do some basic framework to get started with a .kv file and though my main.py compiles, it does not display any buttons. I'm familiar with adding buttons to a layout done through the python language but I'm looking to do it more in the kivy style. Please help!
Here is my main.py
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import StringProperty
import random
class YourWidget(Widget):
random_number = StringProperty()
def __init__(self, **kwargs):
super(YourWidget, self).__init__(**kwargs)
self.random_number = str(random.randint(1, 100))
def change_text(self):
self.random_number = str(random.randint(1, 100))
class YourApp(App):
def build(self):
return YourWidget()
if __name__ == '__main__':
YourApp().run()
and here is my your.kv
#:kivy 1.9.2
<YourWidget>:
BoxLayout:
size: root.size
orientation: 'horizontal'
spacing: 10
padding: 10
Button:
id: btn1
text: "Change Text"
on_release: root.change_text()
size_hint: .3, .3
Button:
id: btn2
text: "Exit App"
on_release: App.get_running_app().stop()
size_hint: .3, .3
Label:
id: lbl1
Font_size: 70
text:root.random_number
size_hint: .3, .3
Let me know anything you could assist with. I'm very new to python and extremely new to packages like kivy. Thank you! Another note is currently I am developing this on a monitor and will port to a touch screen later.
Rename your.kv to yourwidget.kv
when drawing graphics on the canvas the class or Widget name of your game must be reflected also in the kivy file. s

ExtJs changing layout of formpanel buttons

I have a formpanel
var form = new Ext.form.FormPanel({
title: 'Form Layout',
buttons: [
{text: 'Save'},
{text: 'Cancel'}
]
});
I want to change the layout of the buttons below, so that they appear one below the other.
Can I assign a layout to these buttons or is there another way?
Instead of adding as buttons you can go for items into fbar of this form panel , and add each button component here
var form = new Ext.form.FormPanel({
title: 'Form Layout',
buttons: [{
xtype: 'panel',
items: [
{text: 'Save'},
{text: 'Cancel'}
]
}]
});
this helps, but maybe its not a proper solution till i find a real one. marking for now, will change later when a better one arrives

How to get title from HTTP text representation via Qt?

Qt 4.7 DOM API seems kind of strange :(. I have a text HTML representation and need to get "title" text. Seems very easy, but following code is not working, i get empty string:
QDomDocument dom;
dom.setContent( "<html><head><title>this is a title</title></head></html>" );
QString title = dom.elementsByTagName( "title" ).item( 0 ).nodeValue();
Any suggestions?
Try this:
QString title = dom.elementsByTagName( "title" ).item( 0 ).firstChild().nodeValue();
Because the tree structure for text is:
node <title>
=> text element

Resources