Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int MESSAGE_OUT_X = 92;
- const int MESSAGE_OUT_Y = 40;
- const int MESSAGE_OUT_WIDTH = 128;
- const int MESSAGE_OUT_HEIGHT = 12`;
- const int MESSAGE_OUT_LAYER = 6;
- const int MESSAGE_OUT_BLACK = 0x0F;
- const int MESSAGE_OUT_TEXT_COLOUR = 0x01; //White, in the Classic tileset
- const int MESSAGE_OUT_TEXT_FONT = 9; //NES
- const int MESSAGE_OUT_TEXT_XOFS = 4; //Text offset from edge of rectangle.
- const int MESSAGE_OUT_TEXT_YOFS = 4; //Text offset from edge of rectangle.
- //DrawMessageBox(MESSAGE_OUT_LAYER, MESSAGE_OUT_X, MESSAGE_OUT_Y, MESSAGE_OUT_WIDTH, MESSAGE_OUT_HEIGHT, id, MESSAGE_OUT_BLACK, MESSAGE_OUT_TEXT_COLOUR, text_colour, true);
- bool DrawMessageBox(int layer, int x, int y, int height, int width, int message, int colour, int text_colour, int font, bool opaque_bg)
- {
- Screen->Rectangle(layer,x,y,height,width,colour,100, 0,0,0,true,Cond(opaque_bg,OP_OPAQUE,OP_TRANS));
- int buf[256];
- GetMessage(id,buf);
- Screen->DrawString(6,x+MESSAGE_OUT_TEXT_XOFS,y+MESSAGE_OUT_TEXT_YOFS,font,text_colour, -1,0,buf,128);
- while(!Link->PressB || !Link->PressA )
- {
- Waitframe(); //or WaitNoAction()
- }
- return true;
- }
- const int FONST_SPACING_NES = 9; //8 pixels plus one for spacing. ...or does the NES font have two pixels for spacing? or none?
- //Only uses NES font, but is autosized. to width of string. Won't handle line-wraps!
- //DrawMessageBoxAS(MESSAGE_OUT_LAYER, MESSAGE_OUT_X, MESSAGE_OUT_Y, MESSAGE_OUT_WIDTH, MESSAGE_OUT_HEIGHT, id, MESSAGE_OUT_BLACK, MESSAGE_OUT_TEXT_COLOUR, text_colour, true);
- bool DrawMessageBoxAS(int layer, int x, int y, int height, int width, int message, int colour, int text_colour, bool opaque_bg)
- {
- int width;
- int buf[256];
- GetMessage(id,buf);
- for ( int q = 0; buf[q] != 0; ++q )
- {
- size += FONST_SPACING_NES;
- }
- Screen->Rectangle(layer,x,y,height,width,colour,100, 0,0,0,true,Cond(opaque_bg,OP_OPAQUE,OP_TRANS));
- Screen->DrawString(6,x+MESSAGE_OUT_TEXT_XOFS,y+MESSAGE_OUT_TEXT_YOFS,0,text_colour, -1,0,buf,128);
- while(!Link->PressB || !Link->PressA )
- {
- Waitframe(); //or WaitNoAction()
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement