cyan text for italics

This commit is contained in:
2023-07-04 09:37:12 -06:00
parent 4c6bff1298
commit 218b4f95f9
2 changed files with 14 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
# @install: lix --silent download "gh://github.com/kiss-lang/kiss-flixel#516ca9cbdeaad166f9429eddcd2498bc410ba082" into kiss-flixel/0.0.0/github/516ca9cbdeaad166f9429eddcd2498bc410ba082
# @install: lix --silent download "gh://github.com/kiss-lang/kiss-flixel#6bfcf84328e5ced6dfc92cf140a97326cc592208" into kiss-flixel/0.0.0/github/6bfcf84328e5ced6dfc92cf140a97326cc592208
-lib flixel
-lib flixel-addons
-lib flixel-ui
@@ -6,5 +6,5 @@
-lib kiss-tools
-lib lime
-lib openfl
-cp ${HAXE_LIBCACHE}/kiss-flixel/0.0.0/github/516ca9cbdeaad166f9429eddcd2498bc410ba082/src/
-cp ${HAXE_LIBCACHE}/kiss-flixel/0.0.0/github/6bfcf84328e5ced6dfc92cf140a97326cc592208/src/
-D kiss-flixel=0.0.0

View File

@@ -420,6 +420,13 @@
(var SUPER_MARGIN 10)
(method applyFormat [:FlxText text]
(text.applyMarkup
text.text
[
(new FlxTextFormatMarkerPair (new FlxTextFormat FlxColor.CYAN) "*")
]))
(method showDialog [:String speakerName :SpeechType<ActorFlxSprite> type :String wryly :String text :Continuation cc]
// TODO handle text messages, wrylies, off-screen, from-phone, etc. via (case type)
// TODO attribute on-screen dialogue to the character's stageposition
@@ -429,7 +436,7 @@
(case type
(Super
(when superText (FlxG.state.remove superText true))
(set superText (SpriteTools.textPlate text DIALOG_SIZE SUPER_MARGIN))
(set superText (SpriteTools.textPlate text DIALOG_SIZE SUPER_MARGIN null null applyFormat))
// If supertext can be done in a single centered line, do so
(when (<= superText.width FlxG.width)
(set superText.cameras [flxMovie.uiCamera])
@@ -464,10 +471,11 @@
(set dialogText (new FlxText flxMovie.DIALOG_X flxMovie.DIALOG_Y flxMovie.DIALOG_WIDTH "" DIALOG_SIZE)))
(set dialogText.cameras [flxMovie.uiCamera])
(FlxG.state.add dialogText)
// *cyan* for italics
(set dialogText.text text)
// TODO actually page through the dialog instead of sizing it down?
// ^ though that doesn't work automatically with VO unless individual word times are kept in the json
// (which would be really clunky)
(applyFormat dialogText)
(set dialogText.size DIALOG_SIZE)
(while (< FlxG.height (+ dialogText.y dialogText.height))
(-= dialogText.size 6))