Hi there,
So I’ve recently began to try and learn to use and develop an application using the SDK framework.
I have been following the “Getting Started” section on the docs:
For the completed project:
So to give more context, there is the Main.js component that declares the information that’s displayed / used as an action for the navigation menu in the Tic-Tac-Toe app:
static _template(){
return {
Menu:{
x: 600, y:400,
type: Menu, items:[
{label:'START NEW GAME',action:'start'},
{label:'CONTINUE',action:'continue'},
{label:'ABOUT',action:'about'},
{label:'EXIT', action:'exit'}
],
}
}
}
The items are set within Menu.js:
this.tag("Items").children = v.map((el, idx)=>{
return {type: Item, action: el.action, label: el.label, y: idx*90}
})
}
get items(){
return this.tag("Items").children;
}
And finally, the actual individual item components are created within Item.js:
static _template(){
return {
text:{text:'', fontFace:'regular', fontSize:50},
logo:{src:''}
}
}
set label(v){
this.text.text = v;
}
set action(v){
this._action = v;
}
get action(){
return this._action;
}
So the main question that I have, is if I wanted to use the same logic and structure of a menu
But instead of the menu items being a text-based list, I want to also include images within the list items.
Is there any examples that could be provided in which this is used / achieved? I’ve tried a few different approaches while using the same logic to feed the Src, X, Y, W & H values from the Main.js along to Item.js but I can never seem to get it to work.
Any help would be highly appreciated! Thanks in advance for reading