Skip to content

Commit

Permalink
more fixes and doc sync
Browse files Browse the repository at this point in the history
  • Loading branch information
ericoporto committed Apr 20, 2024
1 parent a28eca0 commit 6e46259
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 25 deletions.
30 changes: 9 additions & 21 deletions README.BBCode
Original file line number Diff line number Diff line change
Expand Up @@ -73,38 +73,26 @@ void repeatedly_execute_always()
[size=12pt][b]Script Extensions[/b][/size]

[font=Courier New][b]DrawingSurface.DrawFancyString[/b][/font]
[code]void DrawingSurface.DrawFancyString(int x, int y, FancyConfig* config, const string text);[/code]
[code]void DrawingSurface.DrawFancyString(int x, int y, const string text, optional FancyConfig* config, optional int width);[/code]
Draw the text from a fancy string on the drawing surface.

[font=Courier New][b]DrawingSurface.DrawFancyStringWrapped[/b][/font]
[code]void DrawingSurface.DrawFancyStringWrapped(int x, int y, int width, FancyConfig* config, const string text);[/code]
Draws text with fancy parsing wrapped within specified boundaries on the drawing surface.


[font=Courier New][b]DynamicSprite.CreateFromFancyString[/b][/font]
[code]DynamicSprite* DynamicSprite.CreateFromFancyString(FancyConfig* config, const string text);[/code]
[code]DynamicSprite* DynamicSprite.CreateFromFancyString(const string text, optional FancyConfig* config, optional width);[/code]
Create a sprite with the text of a fancy string

[font=Courier New][b]DynamicSprite.CreateFromFancyStringWrapped[/b][/font]
[code]DynamicSprite* DynamicSprite.CreateFromFancyStringWrapped(int width, FancyConfig* config, const string text);[/code]
Create a sprite with the text of a fancy string wwith word-wrap at set width

[font=Courier New][b]DynamicSprite.CreateFromFancyTextBox[/b][/font]
[code]DynamicSprite* DynamicSprite.CreateFromFancyTextBox(FancyConfig* config, Fancy9Piece* f9p, const string text, int width = FANCY_INFINITE_WIDTH);[/code]
[code]DynamicSprite* DynamicSprite.CreateFromFancyTextBox(const string text, optional FancyConfig* config, optional width, optional Fancy9Piece* f9p);[/code]
Create a sprite of a textbox with a fancy string using a 9-piece.


[font=Courier New][b]Overlay.CreateFancyTextual[/b][/font]
[code]Overlay* Overlay.CreateFancyTextual(int x, int y, int width, FancyConfig* config, const string text);[/code]
Creates a screen overlay from fancy text

[font=Courier New][b]Overlay.CreateFancyTextBox[/b][/font]
[code]Overlay* Overlay.CreateFancyTextBox(int x, int y, int width, FancyConfig* config, const string text, Fancy9Piece* f9p);[/code]
[code]Overlay* Overlay.CreateFancyTextBox(int x, int y, const string text, optional FancyConfig* config, optional int width, optional Fancy9Piece* f9p );[/code]
Creates a screen overlay from a textbox with a fancy string using a 9-piece


[font=Courier New][b]Button.Fancify[/b][/font]
[code]void Button.Fancify(Fancy9Piece* normal, Fancy9Piece* mouse_over = 0, Fancy9Piece* pushed = 0);[/code]
[code]void Button.Fancify(optional Fancy9Piece* normal, optional Fancy9Piece* mouse_over, optional Fancy9Piece* pushed);[/code]
Sets a button NormalGraphic and additional sprites from it's text, assumed as fancy string, and 9-piece.

[font=Courier New][b]Button.UnFancify[/b][/font]
Expand Down Expand Up @@ -153,10 +141,6 @@ By default, when using create, if you don't set, outline color is initially set

[size=12pt][b]FancyTextBase[/b][/size]

[font=Courier New][b]FancyTextBase.SetDrawingConfig[/b][/font]
[code]void FancyTextBase.SetDrawingConfig(FancyConfig* config);[/code]
Sets the drawing configuration for fancy text rendering.

[font=Courier New][b]FancyTextBase.SetDrawingArea[/b][/font]
[code]void FancyTextBase.SetDrawingArea(int x, int y, int width = FANCY_INFINITE_WIDTH);[/code]
Sets the area for drawing fancy text, specifying the position and width.
Expand All @@ -169,6 +153,10 @@ Sets the text content for the fancy text, this is where the parsing of the text
[code]void FancyTextBase.Draw(DrawingSurface* surf);[/code]
Draws the fancy text on the specified drawing surface.

[font=Courier New][b]FancyTextBase.FancyConfig[/b][/font]
[code]attribute FancyConfig* FancyTextBase.FancyConfig;[/code]
Property to set the Fancy Text rendering configuration.


[size=12pt][b]FancyTypedText[/b][/size]

Expand Down
6 changes: 4 additions & 2 deletions fancy_demo/fancy.asc
Original file line number Diff line number Diff line change
Expand Up @@ -737,11 +737,13 @@ void UnFancify(this Button*)
}

FancyConfig* FancyTextBase::get_FancyConfig()
{
{
if(this._cfg == null) {
this._cfg = FancyConfig.Create(0, 65535 /* white */);
}
return this._cfg;
}


void FancyTextBase::set_FancyConfig(FancyConfig* value)
{
if(value == null) {
Expand Down
1 change: 0 additions & 1 deletion fancy_demo/fancy.ash
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ builtin managed struct Fancy {
};

struct FancyTextBase {

/// Set drawing limits
import void SetDrawingArea(int x, int y, int width = FANCY_INFINITE_WIDTH);
/// Sets the text of the fancy text box
Expand Down
3 changes: 2 additions & 1 deletion fancy_demo/room1.asc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function room_AfterFadeIn()
surf.DrawFancyString(10, 170, "[c:61025]A [o:33153]key[/o] [s:2042][/c]!", FancyConfig.Create(eFontSpeechWithoutOutline, 65535), 60);

// using text base
fttb.FancyConfig = FancyConfig.Create(eFontSpeechWithoutOutline, 22422);
fttb.FancyConfig.Font = eFontSpeechWithoutOutline;
fttb.FancyConfig.TextColor = 22422;
fttb.SetDrawingArea(48, 48, 200);
fttb.Start("Hello!\n[o:8560]Can you find me the [c:27647]blue cup [s:2041][/c][/o]?\nI lost it in the [c:red]dangerous [f:0]planet[/f][/c], somewhere.");

Expand Down

0 comments on commit 6e46259

Please sign in to comment.