Hi,
Is it possible to display text that follows a curved line like say a circle with coding so not bitmapped ?
Now I'm using a dc.drawText command but that is only horizontally.
Kind regards,
Dirkvd001
Here's a quick proof of concept.
What's the point of a proof of concept without sharing an explanation? Even the gif could be fake.
function onUpdate(dc) {
dc.setColor(Gfx.COLOR_BLUE, Gfx.COLOR_BLACK);
//Draw line
var offset = 70;…
function onUpdate(dc) {
dc.setColor(Gfx.COLOR_BLUE, Gfx.COLOR_BLACK);
//Draw line
var offset = 70;
for (var i = 0; i < dc.getWidth(); ++i) {
dc.drawPoint(i, offset + formula(i));
}
dc.setColor(Gfx.COLOR_WHITE, Gfx.COLOR_TRANSPARENT);
var text = "Just some text";
var font = Gfx.FONT_MEDIUM;
var x = (dc.getWidth() - (dc.getTextWidthInPixels(text, font) + text.length() - 1)) / 2;
offset -= dc.getFontAscent(font);
//Draw text
for (var i = 0; i < text.length(); ++i) {
var symbol = text.substring(i, i + 1);
dc.drawText(x, offset + formula(x), font, symbol, Gfx.TEXT_JUSTIFY_CENTER);
x += dc.getTextWidthInPixels(symbol, font) + 1;
}
}
//Formula for your curved line
function formula(x) {
var y = 20 * Math.sin(x / 30f);
return y;
}
I think the native one dont use iq sdk or May be it is not a text but a bitmap.
Those are not CIQ.
But it is possible in CIQ (and probably a lot of work)
See: https://apps.garmin.com/en-US/apps/2abcf23e-f82d-4157-857d-cc61025943e7