Hi!
I’ve setup a Custom image sheet for an on-off switch according to this doc: Custom Image Sheet — On-Off Switch
The bit I cant seem to figure out is how to add higher resolution images for it, such as @2x, @3x etc. Simply adding high res images for the mask didn’t work.
Any ideas?
TIA,
/Marcus
//Code//
– Image sheet options and declaration for musicSwitch
local options = {
frames = {
{ x=0, y=0, width=160, height=44 },
{ x=0, y=45, width=42, height=42 },
{ x=44, y=45, width=42, height=42 },
{ x=88, y=44, width=96, height=44 }
},
sheetContentWidth = 184,
sheetContentHeight = 88
}
local onOffSwitchSheet = graphics.newImageSheet( “IMG/widgetsheet.png”, options )
– Create the widget
local musicSwitch = widget.newSwitch
{
left = 180,
top = 230,
style = “onOff”,
id = “musicSwitch”,
onPress = onSwitchPress,
sheet = onOffSwitchSheet,
onOffBackgroundFrame = 1,
onOffBackgroundWidth = 160,
onOffBackgroundHeight = 44,
onOffMask = “IMG/widgetmask.png”,
onOffHandleDefaultFrame = 2,
onOffHandleOverFrame = 3,
onOffOverlayFrame = 4,
onOffOverlayWidth = 96,
onOffOverlayHeight = 44
}