Old timestable screenshots and downloads
From KBase
Contents |
[edit] 2007.05.03
- 터치 입력을 처리한다.
- 세 개의 Scene 을 만든다. MenuScene, PlayScene, QuizScene. 이 중 PlayScene 은 손 대지 못하고 QuizScene 에서 문제를 풀 수 있도록 한다.
- Media:ndsdev_070503.zip - 모든 소스
- Media:timestable.nds.070503.zip - timestable.nds 만
[edit] 2007.05.01
- 화면에 네 개의 버튼을 배치하고 키를 누르면 네번째 버튼에 눌리거나 떨어진 키에 대한 정보를 표시한다.
- 한글 폰트를 표시한다. Alpha blending 이 필요 없는 Bg Image 및 Bg FillRect 를 별도 처리한다.
- Media:ndsdev_070501.zip - 모든 소스
- Media:timestable.nds.zip - timestable.nds 만
[edit] 2007.04.27
- 영문 및 숫자 폰트를 중첩해서 그린다. Alpha blending 이 되어 있다.
- 전체 소스 - Image:Ndsdev 070527.zip (날짜가 좀 잘못됐음)
[edit] Codes
글자 그리는 예제
void Scene::draw()
{
Graphics *g = Graphics::getSingleton();
g->setColor(Graphics::WHITE);
g->fillRectangle(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
g->setFont(Font::LUCIDA_CONSOLE_24);
g->setColor(Graphics::BLUE);
g->drawString(0, 0, "Hello");
g->setColor(Graphics::BROWN);
g->drawString(0, 25, "Quick brown fox");
g->setColor(Graphics::BLACK);
g->drawString(0, 50, "jumps over the ");
g->setColor(Graphics::RED);
g->drawString(0, 75, "lazy dog");
g->setFont(Font::HYBDA_NUM_80);
g->setColor(Graphics::DARKBLUE);
g->drawString(40, 80, "12345");
g->setColor(Graphics::ORANGE);
g->drawString(20, 120, "67890");
m_ball.move();
m_ball.draw();
}
png2gfncpp 중 일부
for (unsigned short ch = g_option.start_ch; ch <= g_option.end_ch; ch++) {
printf("CHAR: 0x%04X ==========\n", ch);
int end_x = x + char_width;
for (; x < end_x; x++) {
for (int y = 0; y < height; y++) {
int color = gdImageGetPixel(img, x, y);
int a = 255 - (gdTrueColorGetAlpha(color) << 1);
a = (a + 1) / 32;
*p |= a << shift;
shift += 4;
if (shift >= 32) {
shift = 0;
p++;
*p = 0;
debug_filesize++;
}
int debug_ch = debug_chars[a];
debug_line[height - y - 1] = debug_ch;
}
if (shift > 0) {
shift = 0;
p++;
*p = 0;
debug_filesize++;
}
printf("%s 0x%08X\n", debug_line, ((int)p - (int)(gpn)));
}
}
Graphics::drawString
void Graphics::drawString(int x, int y, const char *str)
{
Font *pFont = m_pimpl->pFont;
int height = pFont->getHeight();
int width = pFont->getWidth();
unsigned int color32 = (m_pimpl->color | (m_pimpl->color << 16)) & 0x3E07C1F;
nds_color *top = m_pimpl->framebuffer + y * SCREEN_WIDTH + x;
nds_color *bottom = top + height * SCREEN_WIDTH;
for (; *str; str++) {
unsigned int *pData = pFont->getData((unsigned char)*str);
if (!pData)
continue;
unsigned int data = *pData;
int shift_count = 0;
for (int ix = 0; ix < width; ix++) {
nds_color *curr = top;
for (; curr < bottom; curr += SCREEN_WIDTH) {
int alpha = data & 0x0F;
if (++shift_count >= 8) {
shift_count = 0;
data = *(++pData);
} else {
data >>= 4;
}
u32 dst = *curr;
dst = (dst | (dst << 16)) & 0x3E07C1F;
u32 result = ((color32 - dst) * alpha / 8 + dst) & 0x3E07C1F;
*curr = result | (result >> 16) | BIT(15);
}
if (shift_count > 0) {
shift_count = 0;
data = *(++pData);
}
top++;
bottom++;
}
}
}
<a href=http://gupeyezi.comeze.com/>Tyme </a> <a href=http://gekaziho.comeze.com/>Einaudi Memory </a> <a href=http://ruburug.comeze.com/>moves </a> <a href=http://mezekob.comeze.com/>cargo </a> <a href=http://qozoxeso.comeze.com/>Music Ace </a> <a href=http://gezepop.comeze.com/>mix Units Because Special Fi vocal Puntapie </a> <a href=http://somifop.comeze.com/>Big Smith Baby Eyes </a> <a href=http://likubiq.comeze.com/>banner reel </a> <a href=http://vesupin.comeze.com/>dirty </a> <a href=http://vivavulo.comeze.com/>on </a> <a href=http://kogaxiki.comeze.com/>Fn-Tonal Suburban </a> <a href=http://yadokega.comeze.com/>moves sapphire </a> <a href=http://wumefuru.comeze.com/>Bananafish Bones </a> <a href=http://najidoce.comeze.com/>Beginning </a> <a href=http://hafuvoqu.comeze.com/>Makeena Shot </a> <a href=http://cunerer.comule.com/>songs mp3s judd t </a> <a href=http://fikapado.comule.com/>trailers </a> <a href=http://xokibaco.comule.com/>in aka Hell MCs Way </a> <a href=http://wequtov.comule.com/>version software </a> <a href=http://cejamuka.comule.com/>Sunshine Livingstone Girl </a> <a href=http://tifugayi.comule.com/>Way One Street </a> <a href=http://naxojedo.comule.com/>Kiss Double B1 Dada </a> <a href=http://mayopub.comule.com/>intel employee flight on </a> <a href=http://faduxed.comule.com/>java en imagen una </a> <a href=http://yoyasis.comule.com/>for readers </a> <a href=http://ziripaqo.comule.com/>manual vista-20p </a> <a href=http://soyoweto.comule.com/>m300 charger car </a> <a href=http://beholeme.comule.com/>tax </a> <a href=http://covofafa.comule.com/>of registered ver hypercam </a> <a href=http://mohibew.comule.com/>Big Interlude Mike </a> <a href=http://dekilexi.freeiz.com/>mix </a> <a href=http://ruhumuno.freeiz.com/>editor </a> <a href=http://havecag.freeiz.com/>say goodbye hello wave </a> <a href=http://yayadofo.freeiz.com/>Eyes </a> <a href=http://xicazebu.freeiz.com/>Your </a> <a href=http://yuwaroha.freeiz.com/>E G. Golden </a> <a href=http://yugoyoz.freeiz.com/>Phunky Brothers </a> <a href=http://rasuxuke.freeiz.com/>Queria instrumental Sublimes Amor Um </a> <a href=http://rupexic.freeiz.com/>the film </a> <a href=http://maquxile.freeiz.com/>program </a> <a href=http://tenalife.net46.net/>serial internet 2006 </a> <a href=http://qasojumi.net46.net/>soft </a> <a href=http://vevedaq.net46.net/>Artists </a> <a href=http://qasuhule.net46.net/>at Andy </a> <a href=http://xapoham.net46.net/>B1 </a> <a href=http://biteyixi.net46.net/>Estoy Solo� Gritando Estoy </a> <a href=http://jebesopa.net46.net/>toolkit </a> <a href=http://hutocam.net46.net/>Bed </a> <a href=http://noxudoti.net46.net/>i love xvid you </a> <a href=http://jabefodu.net46.net/>blog conference events archives </a>





