After successfully being able to add an image to a Window object with the help of How to add an image to a window in Pebble.js?, I tried adding the image to a white background. The image is a png so it's transparent, but the background shows up as black even with the clear parameter set. Any help on this?
EDIT Here is the code:
// function that adds general elements to the window (top bar, icon, title, and text)
var addElementsToWindow = function(window, text) {
// Top rectangle
var rect = new UI.Rect({
position: new Vector2(0, 0),
size: new Vector2(144, 26),
backgroundColor:'black'
});
// icon
var icon = new UI.Image({
position: new Vector2(100,20),
size: new Vector2(25,26),
backgroundColor: 'clear',
borderColor: 'clear',
image: 'images/menu_icon.png'
});
// Title text
var title = new UI.Text({
position: new Vector2(0, 30),
size: new Vector2(144, 138),
text:'Title',
font:'gothic-24-bold',
color:'black',
textOverflow:'wrap',
textAlign:'center',
backgroundColor:'white'
});
// Loading text
var subtext = new UI.Text({
position: new Vector2(0, 60),
size: new Vector2(144, 108),
text:text,
font:'gothic-24',
color:'black',
textOverflow:'wrap',
textAlign:'center',
backgroundColor:'white'
});
// Display the home screen
window.add(rect);
window.add(title);
window.add(subtext);
window.add(icon);
};
// Create the home screen
var home = new UI.Window();
addElementsToWindow(home, 'Loading...');
home.show();
From the documentation
Try "normal".
EDIT: It's also possible the background of your image is white not transparent.