The Moon in TME is just programed based on the time of day, day of the month, and direction looking.
The view panel on tme is 512 by 384. Exactly double of the spectrum screen.
I have a 1600 wide sky which gets panned by 200 pixels depending on which direction you are looking. North being 0, ne 1, e 2 etc.. the 200 is just
sky width / no directions
On this sky the moon starts to rise within the last four hours of day.
<time id="0" shade="#00202020" sky="sky/sky_00.jpg" moon="974,80" scale="1.0" />
<time id="1" shade="#00262626" sky="sky/sky_01.jpg" moon="812,113" scale="1.33" />
<time id="2" shade="#002c2c2c" sky="sky/sky_02.jpg" moon="637,168" scale="1.5" />
<time id="3" shade="#00444444" sky="sky/sky_03.jpg" moon="462,223" scale="2.0" />
moon being the x,y coordinates. Notice the scale of the moon getting smaller as it gets highers... this is turned off by default in TME.
So the calc for the position in TMEis as follows.
Where image is the moon image.
PANEL_WITH = 512
PANEL_HEIGHT = 384
PANEL_STARTY = 0
x+= PANEL_WIDTH;
x-= direction *m_sky->Width()/8 ;
x+= ((image->Width()*scale)/2) ;
x-= (PANEL_WIDTH/2);
x+=20;
y+=PANEL_STARTY-((image->Height()*scale)/2);
The 20 is just a "makes it look better" value!
Anyway, don't know if that is what you want... but you could do this with the sun as well.
I have 14 moon images, so you get 2 days of each wax and wane
int moonno = ( (int)days%28)/2;