Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let dialogue = ObjText_Create(); // Main Dialogue Text
- let enmName = ObjText_Create(); // Enemy Name
- let PIMG = ObjPrim_Create(OBJ_SPRITE_2D); //Player Image Object
- let box = ObjPrim_Create(OBJ_SPRITE_2D);//The transparent box that appears under the text in TH1-12
- ObjPrim_SetTexture(box, GetCurrentScriptDirectory~"/img/Box.png"); //same box
- ObjSprite2D_SetSourceRect(box, 0, 0, 344, 50); //Setting location for box texture to be taken from source image
- ObjSprite2D_SetDestCenter(box); //Set center
- ObjPrim_SetTexture(PIMG, GetCurrentScriptDirectory~"/img/Reimu.png"); //Set player image object texture
- ObjSprite2D_SetSourceRect(PIMG, 0, 0, 200, 400); //Setting rectangle to display texture
- ObjSprite2D_SetDestCenter(PIMG); //Setting center of player object
- let EIMG = ObjPrim_Create(OBJ_SPRITE_2D); // Enemy Image Object
- let FuncSrc; //****Honestly not sure what this does until****
- local {
- FuncSrc = GetCurrentScriptDirectory;
- }
- //**** Here****
- let cx = GetStgFrameWidth()/2; // defining center of screen x
- let cy = GetStgFrameHeight()/2; // ditto y
- /*
- Alrighty
- Directions for using this fucnction:
- Arguments are as follows: Who starts talking first, Path to Enemy Image, "Name of Enemy", The Line on which music starts, the text at the very beginning.
- */
- function DialogueStarter(Starting, EnemyImg, SrcX, SrcY, EnemyName, MusicStartLine, StartingText){ // 0 = Player Start, 1 = Enemy Start.
- SetForbidPlayerShot(true); //Don't want no bombs being used during MY script
- SetForbidPlayerSpell(true);
- if(Starting == 0) { ObjText_SetFontColorTop(dialogue, 255, 10, 10); ObjText_SetFontColorBottom(dialogue, 255, 255, 255); } //setting color of text object to reflect player talking
- if(Starting == 1) { ObjText_SetFontColorTop(dialogue, 0, 0, 255); ObjText_SetFontColorBottom(dialogue, 0, 0, 0); } //setting color of text object to reflect enemy talking
- ObjRender_SetPosition(PIMG, cx - 120, cy + 80, 1); //Setting position of player image Object
- ObjRender_SetScaleXYZ(PIMG, 0.5, 0.75, 1);
- ObjPrim_SetTexture(EIMG, EnemyImg);//Set enemy texture
- ObjSprite2D_SetSourceRect(EIMG, 0, 0, SrcX, SrcY); //Set source from which texture will be displayed
- ObjSprite2D_SetDestCenter(EIMG); //Set center
- ObjRender_SetPosition(EIMG, cx + 120, cy + 80, 1); //Set position
- ObjRender_SetScaleXYZ(EIMG, 0.5, 0.75, 1); //Scale
- ObjRender_SetPosition(enmName, GetStgFrameWidth - 100, GetStgFrameHeight - 100, 9999); //Text object w/ enemy name (Not top left like the boss, a little cutin with name + title)
- ObjText_SetText(dialogue, StartingText); //Set the text of the dialogue to the argument StartingText
- ObjRender_SetPosition(dialogue, cx - 60, GetStgFrameHeight()- 100, 1); //Set the position of the dialogue text inside the box
- /*
- POTENTIAL PROBLEM ABOVE- Is Z = 1 the highest point on the screen or the lowest?
- */
- ObjText_SetFontSize(dialogue, 14); //Setting font size
- ObjRender_SetPosition(box,cx, GetStgFrameHeight - 75, 99);
- }
- function ChangeText(speak, WORDS) { //This handles the changing of text in the main dialogue box.
- if(speak == 0) { //If player is speaking first
- ObjRender_SetColor(EIMG, 0, 0 ,0); //Set enemy image to transparent
- ObjRender_SetBlendType(EIMG, BLEND_ALPHA); //Same
- ObjRender_SetAlpha(EIMG, 100);//Same
- ObjRender_SetAlpha(PIMG, 255); //Make player opaque
- ObjText_SetFontColorTop(dialogue, 255, 0, 0); //Set color of text
- ObjText_SetFontColorBottom(dialogue, 255, 255, 255); //Yep
- }
- if(speak == 1) { //If enemy is speaking first
- ObjRender_SetColor(PIMG, 0, 0 ,0); //Setting player image to transparent
- ObjRender_SetBlendType(PIMG, BLEND_ALPHA); //Same
- ObjRender_SetAlpha(PIMG, 100); //Same
- ObjRender_SetAlpha(EIMG, 255);//Make enemy opaque
- ObjText_SetFontColorTop(dialogue, 0, 255, 0); //Setting color of text
- ObjText_SetFontColorBottom(dialogue, 0, 0, 0); //Yep
- }
- ObjText_SetText(dialogue, WORDS); //Set text.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement