Languages

Menu
Sites
Language
adding an image on specific position to the screen

Guys,

 

I am really sorry for my dumb questions. I am not a developer but I am trying to develop a watchface for my own taste on Gear 2.

I want to display an image on specific position to the screen.

I don't know what is the correct way of doing this but  I found out that I can add it in style.css

So I put in css:

[code]

#image1 {
    position: absolute;
    top: 100;
    left: 100;
    background-image: url('../images/image1.png');
}

#image1.hidden {
    position: absolute;
    top: 100;
    left: 100;
    background-image: url('../images/image_empty.png');
}

[/code]

then in the js file, at any place I want to display, I put:

[code]

image1.classList.remove('hidden');

image1 = document.getElementById('image1');

[/code]

 

it never shows up.

What am I missing ?

 

please, if there is a better way of doing this, just let me know.

 

thx.

Responses

1 Replies
mekabe remain

nevermind I solved this using "context.drawImage"