Design 中文文章

脑内开坑: 歌语计划屏保。

Keng: Gy Screensaver.

<a href="#1-fetch-information-from-Gy-server" class="headerlink" ti

This article is last updated over 6 years ago, the information mentioned may be changed or developed.

Keng: Gy Screensaver.

1, fetch information from Gy server

File format:
possibly XML, or JSON?
Consist of all of posts

Separated API port for update date.
Program checks the update date compare to the local one. If the later one is newer, then update the local list.
Use local list for poor our unavailable internet connection.

2, the main body.

pick lyric from random if picked(a)=false.
label picked(a)=true,
lyric shown count +=1
if lyric shown = size(lyric array) then {lyric shown =0, fill picked(all)=0}
Draw lyric text in a time interval (#setting)

Randomize text size, color, position
Range of text size (#setting)
Range of color: complete hue,
Saturation and brightness are decided such that the text it’s visible on dark/black/starry background.
Text align to center,
[Detect pixel length/height of longest line,
Make a 10-20 px margin,
Draw text, and start timer.
last time of line(a) = length(line(a)) * time factor (speed, #setting)
enter animation: typewriter,
exit animation: fade out, .5s
transition: exit,exit end,enter
after object finish, destroy object

3, otherwise, on web?

directly fetch items number and single item from server by ajax. other applies.

Leave a Reply

Your email address will not be published. Required fields are marked *