We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm trying to make a multi-functional background watch as an Android app but I'm having a difficulty figuring out how to make a 12-hour system with PM/AM, meaning that I've no idea how to do so.
Far I've made a 24-hour digital clock (which can be seen below) but I want to make an animated background for my watch at some point so that rect() I've made really gets in the way of doing that, so I need to know of a way to make it so the numbers doesn't keep going over each other endlessly without the use of a rect().
void draw(){
textAlign(LEFT);
int day = day(); // Values from 1 - 31
int month = month(); // Values from 1 - 12
int year = year(); // 2003, 2004, 2005, etc.
/*
String s = String.valueOf(day);
text(s, 10, 28);
s = String.valueOf(month);
text(b, 10, 56);
s = String.valueOf(year);
text(s, 10, 84);
*/
String d = String.valueOf(day);
String m = String.valueOf(month);
String y = String.valueOf(year);
text(d, 25, 25);
noStroke();
fill(255);
rect(150,250,135,25);
fill(0);
text(nf(hour(), 2)+":"+nf(minute(), 2)+":"+nf(second(), 2),150,275);
}
Also is there a different between the
String s = String.valueOf(day);
s = String.valueOf(month);
s = String.valueOf(year);
or
String d = String.valueOf(day);
String m = String.valueOf(month);
String y = String.valueOf(year);
Does it take more ram/bits to run my watch with String rather than just s or doesn't it matter at all? I'm aiming for making it the most optimal regarding usage of process power / whatever.
I also want to make a normal clock with lines but I'm finding it a little difficult to place the numbers (1-12) in a round circle, any suggestions how to do that beside just putting them in random places (x,y) until I think it looks decent?
PS. how do I use this forum? Bold doesn't seem to work and it doesn't write the code in the way I write it...
Answers
hey fiskefyren,
here's a simple arc-style clock that I made a while ago for a project:
Hopefully this gets you started in the right direction.
as for code formatting, I paste my code in, then click the big 'C' at the top of the textfield. It doesn't seem to do much visually in the editor, it would be nice to get line numbers or something. I think it will code-format it once posted though. As for bold, it looks like it's using Markdown - adding two stars to either side to indicate the bolded word. There's a link to the markdown wikipedia page at the bottom to learn more about what you can use with that.
Hope this helps! ak