FONT AND BULLSHIT
This commit is contained in:
parent
e4b90928ba
commit
b6091a43a7
@ -54,9 +54,12 @@
|
|||||||
|
|
||||||
<assets path="CHANGELOG.md"/>
|
<assets path="CHANGELOG.md"/>
|
||||||
|
|
||||||
|
<!-- NOTE FOR FUTURE SELF SINCE FONTS ARE ALWAYS FUCKY
|
||||||
<assets path="assets/fonts/vcr.ttf" embed="true" />
|
TO FIX ONE OF THEM, I CONVERTED IT TO OTF. DUNNO IF YOU NEED TO
|
||||||
|
THEN UHHH I USED THE NAME OF THE FONT WITH SETFORMAT() ON THE TEXT!!!
|
||||||
|
NOT USING A DIRECT THING TO THE ASSET!!!
|
||||||
|
-->
|
||||||
|
<assets path="assets/fonts" embed='true'/>
|
||||||
<!-- _______________________________ Libraries ______________________________ -->
|
<!-- _______________________________ Libraries ______________________________ -->
|
||||||
|
|
||||||
<haxelib name="flixel" />
|
<haxelib name="flixel" />
|
||||||
|
BIN
assets/fonts/pixel.otf
Normal file
BIN
assets/fonts/pixel.otf
Normal file
Binary file not shown.
BIN
assets/images/weeb/pixelUI/dialogueBox-pixel.png
Normal file
BIN
assets/images/weeb/pixelUI/dialogueBox-pixel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
10
assets/images/weeb/pixelUI/dialogueBox-pixel.xml
Normal file
10
assets/images/weeb/pixelUI/dialogueBox-pixel.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<TextureAtlas imagePath="dialogueBox-pixel.png">
|
||||||
|
<!-- Created with Adobe Animate version 20.0.0.17400 -->
|
||||||
|
<!-- http://www.adobe.com/products/animate.html -->
|
||||||
|
<SubTexture name="Text Box Appear instance 10000" x="0" y="0" width="249" height="144"/>
|
||||||
|
<SubTexture name="Text Box Appear instance 10001" x="259" y="0" width="249" height="144"/>
|
||||||
|
<SubTexture name="Text Box Appear instance 10002" x="0" y="154" width="249" height="144"/>
|
||||||
|
<SubTexture name="Text Box Appear instance 10003" x="259" y="154" width="249" height="144"/>
|
||||||
|
<SubTexture name="Text Box Appear instance 10004" x="259" y="154" width="249" height="144"/>
|
||||||
|
</TextureAtlas>
|
BIN
assets/sounds/pixelText.mp3
Normal file
BIN
assets/sounds/pixelText.mp3
Normal file
Binary file not shown.
BIN
assets/sounds/pixelText.ogg
Normal file
BIN
assets/sounds/pixelText.ogg
Normal file
Binary file not shown.
@ -2,38 +2,99 @@ package;
|
|||||||
|
|
||||||
import flixel.FlxG;
|
import flixel.FlxG;
|
||||||
import flixel.FlxSprite;
|
import flixel.FlxSprite;
|
||||||
|
import flixel.addons.text.FlxTypeText;
|
||||||
import flixel.graphics.frames.FlxAtlasFrames;
|
import flixel.graphics.frames.FlxAtlasFrames;
|
||||||
import flixel.group.FlxSpriteGroup;
|
import flixel.group.FlxSpriteGroup;
|
||||||
import flixel.input.FlxKeyManager;
|
import flixel.input.FlxKeyManager;
|
||||||
|
import flixel.text.FlxText;
|
||||||
|
import flixel.util.FlxTimer;
|
||||||
|
|
||||||
|
using StringTools;
|
||||||
|
|
||||||
class DialogueBox extends FlxSpriteGroup
|
class DialogueBox extends FlxSpriteGroup
|
||||||
{
|
{
|
||||||
var box:FlxSprite;
|
var box:FlxSprite;
|
||||||
|
|
||||||
|
var curCharacter:String = '';
|
||||||
|
|
||||||
var dialogue:Alphabet;
|
var dialogue:Alphabet;
|
||||||
var dialogueList:Array<String> = [];
|
var dialogueList:Array<String> = [];
|
||||||
|
|
||||||
|
// SECOND DIALOGUE FOR THE PIXEL SHIT INSTEAD???
|
||||||
|
var swagDialogue:FlxTypeText;
|
||||||
|
|
||||||
|
var dropText:FlxText;
|
||||||
|
|
||||||
public var finishThing:Void->Void;
|
public var finishThing:Void->Void;
|
||||||
|
|
||||||
|
var portraitLeft:FlxSprite;
|
||||||
|
var portraitRight:FlxSprite;
|
||||||
|
|
||||||
public function new(talkingRight:Bool = true, ?dialogueList:Array<String>)
|
public function new(talkingRight:Bool = true, ?dialogueList:Array<String>)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
|
|
||||||
box = new FlxSprite(40);
|
var bgFade:FlxSprite = new FlxSprite(-200, -200).makeGraphic(Std.int(FlxG.width * 1.3), Std.int(FlxG.height * 1.3), 0xFFB3DFd8);
|
||||||
box.frames = FlxAtlasFrames.fromSparrow('assets/images/speech_bubble_talking.png', 'assets/images/speech_bubble_talking.xml');
|
bgFade.scrollFactor.set();
|
||||||
box.animation.addByPrefix('normalOpen', 'Speech Bubble Normal Open', 24, false);
|
bgFade.alpha = 0;
|
||||||
box.animation.addByPrefix('normal', 'speech bubble normal', 24);
|
add(bgFade);
|
||||||
|
|
||||||
|
new FlxTimer().start(0.83, function(tmr:FlxTimer)
|
||||||
|
{
|
||||||
|
bgFade.alpha += (1 / 5) * 0.7;
|
||||||
|
if (bgFade.alpha > 0.7)
|
||||||
|
bgFade.alpha = 0.7;
|
||||||
|
}, 5);
|
||||||
|
|
||||||
|
portraitLeft = new FlxSprite(-20, 40);
|
||||||
|
portraitLeft.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/senpaiPortrait.png', 'assets/images/weeb/senpaiPortrait.xml');
|
||||||
|
portraitLeft.animation.addByPrefix('enter', 'Senpai Portrait Enter', 24, false);
|
||||||
|
portraitLeft.setGraphicSize(Std.int(portraitLeft.width * PlayState.daPixelZoom * 0.9));
|
||||||
|
portraitLeft.updateHitbox();
|
||||||
|
portraitLeft.scrollFactor.set();
|
||||||
|
add(portraitLeft);
|
||||||
|
portraitLeft.visible = false;
|
||||||
|
|
||||||
|
portraitRight = new FlxSprite(0, 40);
|
||||||
|
portraitRight.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/bfPortrait.png', 'assets/images/weeb/bfPortrait.xml');
|
||||||
|
portraitRight.animation.addByPrefix('enter', 'Boyfriend portrait enter', 24, false);
|
||||||
|
portraitRight.setGraphicSize(Std.int(portraitRight.width * PlayState.daPixelZoom * 0.9));
|
||||||
|
portraitRight.updateHitbox();
|
||||||
|
portraitRight.scrollFactor.set();
|
||||||
|
add(portraitRight);
|
||||||
|
portraitRight.visible = false;
|
||||||
|
|
||||||
|
box = new FlxSprite(-20, 45);
|
||||||
|
box.frames = FlxAtlasFrames.fromSparrow('assets/images/weeb/pixelUI/dialogueBox-pixel.png', 'assets/images/weeb/pixelUI/dialogueBox-pixel.xml');
|
||||||
|
box.animation.addByPrefix('normalOpen', 'Text Box Appear', 24, false);
|
||||||
|
box.animation.addByIndices('normal', 'Text Box Appear', [4], "", 24);
|
||||||
box.animation.play('normalOpen');
|
box.animation.play('normalOpen');
|
||||||
|
box.setGraphicSize(Std.int(box.width * PlayState.daPixelZoom * 0.9));
|
||||||
|
box.updateHitbox();
|
||||||
add(box);
|
add(box);
|
||||||
|
|
||||||
|
box.screenCenter(X);
|
||||||
|
portraitLeft.screenCenter(X);
|
||||||
|
|
||||||
if (!talkingRight)
|
if (!talkingRight)
|
||||||
{
|
{
|
||||||
box.flipX = true;
|
box.flipX = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dropText = new FlxText(242, 502, Std.int(FlxG.width * 0.6), "", 32);
|
||||||
|
dropText.font = 'Pixel Arial 11 Bold';
|
||||||
|
dropText.color = 0xFFD89494;
|
||||||
|
add(dropText);
|
||||||
|
|
||||||
|
swagDialogue = new FlxTypeText(240, 500, Std.int(FlxG.width * 0.6), "", 32);
|
||||||
|
swagDialogue.font = 'Pixel Arial 11 Bold';
|
||||||
|
swagDialogue.color = 0xFF3F2021;
|
||||||
|
swagDialogue.sounds = [FlxG.sound.load('assets/sounds/pixelText' + TitleState.soundExt, 0.6)];
|
||||||
|
add(swagDialogue);
|
||||||
|
|
||||||
dialogue = new Alphabet(0, 80, "", false, true);
|
dialogue = new Alphabet(0, 80, "", false, true);
|
||||||
// dialogue.x = 90;
|
// dialogue.x = 90;
|
||||||
add(dialogue);
|
// add(dialogue);
|
||||||
|
|
||||||
this.dialogueList = dialogueList;
|
this.dialogueList = dialogueList;
|
||||||
}
|
}
|
||||||
@ -43,6 +104,8 @@ class DialogueBox extends FlxSpriteGroup
|
|||||||
|
|
||||||
override function update(elapsed:Float)
|
override function update(elapsed:Float)
|
||||||
{
|
{
|
||||||
|
dropText.text = swagDialogue.text;
|
||||||
|
|
||||||
if (box.animation.curAnim != null)
|
if (box.animation.curAnim != null)
|
||||||
{
|
{
|
||||||
if (box.animation.curAnim.name == 'normalOpen' && box.animation.curAnim.finished)
|
if (box.animation.curAnim.name == 'normalOpen' && box.animation.curAnim.finished)
|
||||||
@ -79,8 +142,39 @@ class DialogueBox extends FlxSpriteGroup
|
|||||||
|
|
||||||
function startDialogue():Void
|
function startDialogue():Void
|
||||||
{
|
{
|
||||||
var theDialog:Alphabet = new Alphabet(0, 70, dialogueList[0], false, true);
|
cleanDialog();
|
||||||
dialogue = theDialog;
|
|
||||||
add(theDialog);
|
// var theDialog:Alphabet = new Alphabet(0, 70, dialogueList[0], false, true);
|
||||||
|
// dialogue = theDialog;
|
||||||
|
// add(theDialog);
|
||||||
|
|
||||||
|
// swagDialogue.text = ;
|
||||||
|
swagDialogue.resetText(dialogueList[0]);
|
||||||
|
swagDialogue.start(0.02, true);
|
||||||
|
|
||||||
|
switch (curCharacter)
|
||||||
|
{
|
||||||
|
case 'dad':
|
||||||
|
portraitRight.visible = false;
|
||||||
|
if (!portraitLeft.visible)
|
||||||
|
{
|
||||||
|
portraitLeft.visible = true;
|
||||||
|
portraitLeft.animation.play('enter');
|
||||||
|
}
|
||||||
|
case 'bf':
|
||||||
|
portraitLeft.visible = false;
|
||||||
|
if (!portraitRight.visible)
|
||||||
|
{
|
||||||
|
portraitRight.visible = true;
|
||||||
|
portraitRight.animation.play('enter');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanDialog():Void
|
||||||
|
{
|
||||||
|
var splitName:Array<String> = dialogueList[0].split(":");
|
||||||
|
curCharacter = splitName[1];
|
||||||
|
dialogueList[0] = dialogueList[0].substr(splitName[1].length + 2).trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,6 +148,12 @@ class PlayState extends MusicBeatState
|
|||||||
"If you can beat me here...",
|
"If you can beat me here...",
|
||||||
"Only then I will even CONSIDER letting you\ndate my daughter!"
|
"Only then I will even CONSIDER letting you\ndate my daughter!"
|
||||||
];
|
];
|
||||||
|
case 'senpai':
|
||||||
|
dialogue = [
|
||||||
|
':dad:Ah, a new fair maiden has come in search of true love!',
|
||||||
|
":dad:A serenade between gentlemen shall decide where her beautiful heart shall reside.",
|
||||||
|
":bf:Beep bo bop"
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SONG.song.toLowerCase() == 'spookeez' || SONG.song.toLowerCase() == 'monster' || SONG.song.toLowerCase() == 'south')
|
if (SONG.song.toLowerCase() == 'spookeez' || SONG.song.toLowerCase() == 'monster' || SONG.song.toLowerCase() == 'south')
|
||||||
@ -511,7 +517,7 @@ class PlayState extends MusicBeatState
|
|||||||
|
|
||||||
var doof:DialogueBox = new DialogueBox(false, dialogue);
|
var doof:DialogueBox = new DialogueBox(false, dialogue);
|
||||||
// doof.x += 70;
|
// doof.x += 70;
|
||||||
doof.y = FlxG.height * 0.5;
|
// doof.y = FlxG.height * 0.5;
|
||||||
doof.scrollFactor.set();
|
doof.scrollFactor.set();
|
||||||
doof.finishThing = startCountdown;
|
doof.finishThing = startCountdown;
|
||||||
|
|
||||||
@ -619,7 +625,9 @@ class PlayState extends MusicBeatState
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
case 'senpai':
|
case 'senpai':
|
||||||
schoolIntro();
|
schoolIntro(doof);
|
||||||
|
case 'roses':
|
||||||
|
schoolIntro(doof);
|
||||||
default:
|
default:
|
||||||
startCountdown();
|
startCountdown();
|
||||||
}
|
}
|
||||||
@ -629,7 +637,7 @@ class PlayState extends MusicBeatState
|
|||||||
switch (curSong.toLowerCase())
|
switch (curSong.toLowerCase())
|
||||||
{
|
{
|
||||||
case 'senpai':
|
case 'senpai':
|
||||||
schoolIntro();
|
schoolIntro(doof);
|
||||||
default:
|
default:
|
||||||
startCountdown();
|
startCountdown();
|
||||||
}
|
}
|
||||||
@ -638,7 +646,7 @@ class PlayState extends MusicBeatState
|
|||||||
super.create();
|
super.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
function schoolIntro():Void
|
function schoolIntro(?dialogueBox:DialogueBox):Void
|
||||||
{
|
{
|
||||||
var black:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK);
|
var black:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK);
|
||||||
black.scrollFactor.set();
|
black.scrollFactor.set();
|
||||||
@ -647,8 +655,6 @@ class PlayState extends MusicBeatState
|
|||||||
new FlxTimer().start(0.3, function(tmr:FlxTimer)
|
new FlxTimer().start(0.3, function(tmr:FlxTimer)
|
||||||
{
|
{
|
||||||
black.alpha -= 0.15;
|
black.alpha -= 0.15;
|
||||||
if (!startedCountdown)
|
|
||||||
startCountdown();
|
|
||||||
|
|
||||||
if (black.alpha > 0)
|
if (black.alpha > 0)
|
||||||
{
|
{
|
||||||
@ -656,6 +662,13 @@ class PlayState extends MusicBeatState
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (dialogueBox != null)
|
||||||
|
{
|
||||||
|
add(dialogueBox);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
startCountdown();
|
||||||
|
|
||||||
remove(black);
|
remove(black);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user