#ifndef DBOX_H
#define DBOX_H

//a dialogue box for dialogue
#import <string.h>
#import <raylib.h>
#import <yeslib.h>
#import <stdlib.h>


/*
    functionality of dbox:
    it will display a rectangle or place to hold text
    it will gradually print text within the box
    it will pause when a certain delimiter is reached
        or other method of pausing the text
    it will continue when it is send a continue message
    
    optional but requirement for quality:
        change text speed upon reaching delimiter
        or other method, probably something in a script
*/

static int thiccness;

@interface DialogueBox : YSObject {
    Vector2 pos;
    Rectangle rect;
    Color inner_color;
    Color outer_color;
    Color text_color;
    int speed; //speed of text drawing
    int left; //ticks left before next char draw

    char *full_text; //a buffer to copy text into

    //display two lines of text
    char *line_top;
    char *line_bottom; //dont need
}

/*
    method of gradually printing text:
        copy the string and slide a null byte through it

    method of controlling speed:
        count ticks until 0

    slide in animation:
        box moves towards target pos then stops
*/

-(id) initWithText: (char *) text;
+(id) newWithText: (char *) text;
//-(void) setText;
-(void) setSpeed: (int) s; //set speed of text
-(void) tick;
-(void) advance; //advance the text
-(void) draw; //draw the rect

@end
#endif