Sorry, didn't know you would need everything
this is the code so far
Code: Select all
#include <nds.h>
#include <stdio.h>
#include <stdlib.h>
#include "kaart.h"
#include "logo.h"
#include "slider.h"
#include "dekantine.h"
#include "schuur2.h"
#include "schuur.h"
int main(void) {
int keys = 0;
//int sx = 0;
int sy = 0;
int tx = 0;
int geselecteerd = 0;
touchPosition touch;
vramSetBankA(VRAM_A_MAIN_BG);
//vramSetBankB(VRAM_B_SUB_BG);
videoSetMode(MODE_5_2D);
videoSetModeSub(MODE_5_2D);
int TopScherm = bgInit(3, BgType_Bmp16, BgSize_B16_256x256, 0,0);
bgSetPriority(TopScherm,3);
decompress(logoBitmap, BG_GFX, LZ77Vram);
int BtmScherm = bgInitSub(3, BgType_Bmp16, BgSize_B16_512x256, 0,0);
bgSetPriority(BtmScherm,3);
decompress(kaartBitmap, BG_GFX_SUB, LZ77Vram);
bgUpdate();
while(!(keys & KEY_B))
{
scanKeys();
keys = keysHeld();
// if(keys & KEY_UP) sy--;
// if(keys & KEY_DOWN) sy++;
// if(keys & KEY_LEFT) sx--;
// if(keys & KEY_RIGHT) sx++;
if(geselecteerd == 1) {
if(keys & KEY_UP and sy > 0 ) sy--;
if(keys & KEY_DOWN and sy < 64 ) sy++;
};
//if(keys & KEY_LEFT) decompress(schuur2Bitmap, BG_GFX, LZ77Vram);
//if(keys & KEY_RIGHT) decompress(schuurBitmap, BG_GFX, LZ77Vram);
//if(keys & KEY_A) decompress(logoBitmap, BG_GFX, LZ77Vram);
touchRead(&touch);
swiWaitForVBlank();
if (touch.px > 1 and touch.py > 140) tx = touch.px;
if (touch.px > 20-tx and touch.px < 50-tx and touch.py >20 and touch.py < 50) {decompress(sliderBitmap, BG_GFX, LZ77Vram); geselecteerd = 1;};
if (touch.px > 80-tx and touch.px < 110-tx and touch.py >30 and touch.py < 60) {decompress(dekantineBitmap, BG_GFX, LZ77Vram); geselecteerd = 1;};
if (touch.px > 140-tx and touch.px < 170-tx and touch.py >40 and touch.py < 70) {decompress(schuur2Bitmap, BG_GFX, LZ77Vram); geselecteerd = 1;};
if (touch.px > 250-tx and touch.px < 280-tx and touch.py >50 and touch.py < 80) {decompress(schuurBitmap, BG_GFX, LZ77Vram); geselecteerd = 1;};
if (touch.px > 320-tx and touch.px < 350-tx and touch.py >60 and touch.py < 90) {decompress(logoBitmap, BG_GFX, LZ77Vram); geselecteerd = 1;};
bgSetScroll(BtmScherm, tx, 0);
bgSetScroll(TopScherm, 0, sy);
bgUpdate();
}
return 0;
}