{"id":21299718,"url":"https://github.com/ericoporto/fancy","last_synced_at":"2026-03-19T19:46:03.752Z","repository":{"id":233281386,"uuid":"786437317","full_name":"ericoporto/fancy","owner":"ericoporto","description":"Script module for fancy text in Adventure Game Studio","archived":false,"fork":false,"pushed_at":"2024-06-23T23:51:40.000Z","size":207,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T07:44:11.444Z","etag":null,"topics":["adventure-game-studio","adventuregamestudio","ags-modules","ags-script","game-ui"],"latest_commit_sha":null,"homepage":"https://www.adventuregamestudio.co.uk/forums/index.php?topic=61549.0","language":"AGS Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericoporto.png","metadata":{"files":{"readme":"README.BBCode","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ericoporto"}},"created_at":"2024-04-14T13:15:20.000Z","updated_at":"2024-06-23T23:51:44.000Z","dependencies_parsed_at":"2024-06-24T00:53:16.569Z","dependency_job_id":"def4916b-0c85-453f-91c4-af90fd2fa38a","html_url":"https://github.com/ericoporto/fancy","commit_stats":null,"previous_names":["ericoporto/fancy"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoporto%2Ffancy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoporto%2Ffancy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoporto%2Ffancy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoporto%2Ffancy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericoporto","download_url":"https://codeload.github.com/ericoporto/fancy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243769985,"owners_count":20345217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adventure-game-studio","adventuregamestudio","ags-modules","ags-script","game-ui"],"created_at":"2024-11-21T15:05:13.132Z","updated_at":"2026-01-03T04:42:48.542Z","avatar_url":"https://github.com/ericoporto.png","language":"AGS Script","funding_links":["https://github.com/sponsors/ericoporto"],"categories":[],"sub_categories":[],"readme":"[size=14pt][b][color=maroon]F[/color][color=hotpink]a[/color][color=navy]n[/color][color=purple]c[/color][color=limegreen]y[/color][/b][/size] [color=gray][b]version 0.7.5 [/b][/color]\n\n[url=\"https://github.com/ericoporto/fancy/releases/download/v0.7.5/fancy.scm\"]Get Latest Release [b]fancy.scm[/b][/url] | [url=\"https://github.com/ericoporto/fancy\"]GitHub Repo[/url] | [url=\"https://github.com/ericoporto/fancy/releases/download/v0.7.5/fancy_demo_windows.zip\"]Project with Demo![/url]\n\n[url=\"https://github.com/ericoporto/fancy/actions\"][img]https://github.com/ericoporto/fancy/actions/workflows/main.yml/badge.svg[/img][/url]\n\nFancy is a Script module for \"fancy\" text in Adventure Game Studio, you can have text with multiple colors, fonts, with sprites and other. It brings it's own Typed-Text mechanism and additional fancyness.\n\nThe cheatsheet of tags are below. Some tags are \"solo\", they don't require a closing tag.\n\n[list]\n[li]Color tag is [font=Courier New]\"[c:123]\"[/font] and [font=Courier New]\"[/c]\"[/font], where [font=Courier New]\"123\"[/font] is an ags color for the text.[/li]\n[li]Outline color tag is [font=Courier New]\"[o:123]\"[/font] and [font=Courier New]\"[/o]\"[/font], where [font=Courier New]\"123\"[/font] is an ags color for the outline.[/li]\n[li]Font tag is [font=Courier New]\"[f:123]\"[/font] and [font=Courier New]\"[/f]\"[/font], where [font=Courier New]\"123\"[/font] is an ags font index.[/li]\n[li]Sprite tag is solo [font=Courier New]\"[s:123]\"[/font], where [font=Courier New]\"123\"[/font] is an ags sprite.[/li]\n[/list]\n\n[i]Note:[/i] use [font=Courier New]\"\\n\"[/font] for linefeed, old lone [font=Courier New]\"[\"[/font] ags linefeed is not supported.\n\nNotice that if you need to pass a number that is dynamic you can use String.Format to create the string with the proper number, like if the sprite icon you want to put in your text is from a dynamic sprite or the color of a word comes from a character speech color.\n\n[img width=640]https://i.imgur.com/w5olTxG.png[/img]\n\n[hr]\n\n[size=14pt][b]Usage[/b][/size]\n\nI will improve this soon, for now some small examples\n\n[i]Using a regular drawing surface:[/i]\n\n[code]function room_AfterFadeIn()\n{\n  Fancy.AddAlias(\"red\", 64493); // this should be at game_start\n\n  DrawingSurface* surf = Room.GetDrawingSurfaceForBackground();\n\n  surf.DrawingColor = 10565;\n  surf.DrawRectangle(48, 48, 248, 108);\n  surf.DrawFancyString(48, 48, \"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.\", FancyConfig.Create(eFontSpeech, 22422), 200);\n}[/code]\n\n[i]Simple not-useful typed text example:[/i]\n\n[code]FancyTypedText fttb; // has to be global\n\nfunction room_AfterFadeIn()\n{\n  Fancy.AddAlias(\"red\", 64493); // this should be at game_start\n  Fancy.AddAlias(\"ico_bcup\", 2041); // this should be at game_start\n\n  fttb.FancyConfig.Font = eFontSpeech;\n  fttb.FancyConfig.TextColor = 22422;\n  fttb.SetDrawingArea(48, 40, 200);\n  fttb.Start(\"Hello!\\n[o:8560]Can you find me the [c:27647]blue cup [s:ico_bcup][/c][/o]?\\nI lost it in the [c:red]dangerous [f:0]planet[/f][/c], somewhere.\");\n}\n\nvoid repeatedly_execute_always()\n{\n  if(fttb.IsTextBeingTyped)\n  {\n    DrawingSurface* surf = Room.GetDrawingSurfaceForBackground();\n    \n    surf.DrawingColor = 10565;\n    surf.DrawRectangle(48, 40, 248, 90);\n    \n    fttb.DrawTyped(surf);\n  }\n}[/code]\n\n\n[hr]\n\n[size=14pt][b]Script API[/b][/size]\n[spoiler]\n[size=12pt][b]Script Extensions[/b][/size]\n\n[font=Courier New][b]DrawingSurface.DrawFancyString[/b][/font]\n[code]void DrawingSurface.DrawFancyString(int x, int y, const string text, optional FancyConfig* config, optional int width);[/code]\nDraw the text from a fancy string on the drawing surface.\n\n\n[font=Courier New][b]DynamicSprite.CreateFromFancyString[/b][/font]\n[code]DynamicSprite* DynamicSprite.CreateFromFancyString(const string text, optional FancyConfig* config, optional width);[/code]\nCreate a sprite with the text of a fancy string\n\n[font=Courier New][b]DynamicSprite.CreateFromFancyTextBox[/b][/font]\n[code]DynamicSprite* DynamicSprite.CreateFromFancyTextBox(const string text, optional FancyConfig* config, optional width, optional Fancy9Piece* f9p);[/code]\nCreate a sprite of a textbox with a fancy string using a 9-piece.\n\n\n[font=Courier New][b]Character.FancySay[/b][/font]\n[code]void Character.FancySay( const string text, optional FancyConfig* config, optional int width, optional Fancy9Piece* f9p );[/code]\nA Say alternative that support fancy strings\n\n[font=Courier New][b]Character.FancySayTyped[/b][/font]\n[code]void Character.FancySayTyped( const string text, optional FancyConfig* config, optional int width, optional Fancy9Piece* f9p );[/code]\nA Say alternative that support fancy strings, it types it instead of readily drawing\n\n\n[font=Courier New][b]Button.Fancify[/b][/font]\n[code]void Button.Fancify(optional Fancy9Piece* normal, optional Fancy9Piece* mouse_over, optional Fancy9Piece* pushed);[/code]\nSets a button NormalGraphic and additional sprites from it's text, assumed as fancy string, and 9-piece.\n\n[font=Courier New][b]Button.UnFancify[/b][/font]\n[code]void Button.UnFancify();[/code]\nRemoves fancyness from button (clear any altered sprites)\n\n\n[size=12pt][b]Fancy[/b][/size]\n\nThis is a global struct you can't instantiate, it contains static methods for global configuration meant to be used at game start.\n\n[font=Courier New][b]Fancy.AddAlias[/b][/font]\n[code]static void Fancy.AddAlias(String key, int value);[/code]\n\nAllows adding a global alias to a tag-value. Ex: AddAlias(\"red\", 63488) allows using [c:red] instead of [c:63488].\n\nThis may be useful if you want to be able to change your mind later on what is the specific of a color, or you want to have an easier type remembering sprite icons you are reusing in your texts.\n\nAlias added here are global to all of Fancy. It's recommended that you only add an alias once to everything you need at the game_start of your project, make it easier to manage aliases.\n\n[font=Courier New][b]Fancy.FancyConfig[/b][/font]\n[code]static attribute FancyConfig* Fancy.FancyConfig;[/code]\n\nThis is the default global FancyConfig, if you don't specify or if you pass null to a method that requires a FancyConfig as parameter it will use this config instead.\n\n\n[size=12pt][b]Fancy9Piece[/b][/size]\n\nThis is a managed struct that holds a 9-piece that can be used for drawing text boxes.\n\n[font=Courier New][b]Fancy9Piece.CreateFromTextWindowGui[/b][/font]\n[code]static Fancy9Piece* Fancy9Piece.CreateFromTextWindowGui(GUI* text_window_gui);[/code]\nCreate a 9 piece fancy compatible from a Text Window GUI.\n\n[font=Courier New][b]Fancy9Piece.CreateFrom9Sprites[/b][/font]\n[code]static Fancy9Piece* Fancy9Piece.CreateFrom9Sprites(int top , int bottom, int left, int right, int top_left, int top_right, int bottom_left, int bottom_right, int center_piece = 0, int bg_color = 0);[/code]\nCreate a 9 piece fancy from 9 sprite slots.\n\nYou can optionally pass a color instead of a sprite for the center piece, by passing 0 to center_piece and a valid ags color in bg_color.\n\n\n[size=12pt][b]FancyConfig[/b][/size]\n\nThis is a managed struct meant to configure an instance from FancyTextBase and extensions, prefer using it's [font=Courier New]Create[/font] method.\n\n[font=Courier New][b]FancyConfig.Create[/b][/font]\n[code]static FancyConfig* FancyConfig.Create(FontType font, int color, int outline_color, int outline_width, Alignment align, int line_spacing);[/code]\nConfiguration structure for fancy text drawing, allowing customization of font, text color, line spacing, and alignment.\nBy default, when using create, if you don't set, outline color is initially set for [font=Courier New]COLOR_TRANSPARENT[/font] and outline width is initially set to 1, align is set to eAlignBottomLeft and line_spacing is 0.\n\n\n[size=12pt][b]FancyTextBase[/b][/size]\n\n[font=Courier New][b]FancyTextBase.SetDrawingArea[/b][/font]\n[code]void FancyTextBase.SetDrawingArea(int x, int y, int width = FANCY_INFINITE_WIDTH);[/code]\nSets the area for drawing fancy text, specifying the position and width.\n\n[font=Courier New][b]FancyTextBase.Text[/b][/font]\n[code]attribute String FancyTextBase.Text;[/code]\nSets the text content for the fancy text, this is where the parsing of the text happens.\n\n[font=Courier New][b]FancyTextBase.PlainText[/b][/font]\n[code]attribute readonly String FancyTextBase.PlainText;[/code]\nGet the set text without tags.\n\n[font=Courier New][b]FancyTextBase.Draw[/b][/font]\n[code]void FancyTextBase.Draw(DrawingSurface* surf);[/code]\nDraws the fancy text on the specified drawing surface.\n\n[font=Courier New][b]FancyTextBase.FancyConfig[/b][/font]\n[code]attribute FancyConfig* FancyTextBase.FancyConfig;[/code]\nProperty to set the Fancy Text rendering configuration.\n\n\n[size=12pt][b]FancyTextBox[/b][/size]\n\n[font=Courier New][b]FancyTextBox.CreateTextBoxSprite[/b][/font]\n[code]DynamicSprite* FancyTextBox.CreateTextBoxSprite();[/code]\nCreate a sprite of a textbox with a fancy string using the configured 9-piece\n\n[font=Courier New][b]FancyTextBox.Fancy9Piece[/b][/font]\n[code]atrribute Fancy9Piece* FancyTextBox.Fancy9Piece;[/code]\nSetup the 9-piece for the Text Box creation.\n\n\n[size=12pt][b]FancyTypedText[/b][/size]\n\n[font=Courier New][b]FancyTypedText.Clear[/b][/font]\n[code]void FancyTypedText.Clear();[/code]\nClears all text and resets everything for typed text.\n\n[font=Courier New][b]FancyTypedText.Start[/b][/font]\n[code]void FancyTypedText.Start(String text);[/code]\nSets a new string and resets everything to start typing. You can then use Tick repeatedly to advance the text.\n\n[font=Courier New][b]FancyTypedText.Skip[/b][/font]\n[code]void FancyTypedText.Skip();[/code]\nSkips all remaining typing of the text.\n\n[font=Courier New][b]FancyTypedText.Tick[/b][/font]\n[code]void FancyTypedText.Tick();[/code]\nUpdates the typed text state, advancing it by a single tick.\n\n[font=Courier New][b]FancyTypedText.DrawTyped[/b][/font]\n[code]void FancyTypedText.DrawTyped(DrawingSurface* surf);[/code]\nDraws the typed text in it's current state.\n\n[font=Courier New][b]FancyTypedText.CreateTypedSprite[/b][/font]\n[code]DynamicSprite* FancyTypedText.CreateTypedSprite();[/code]\nCreate a sprite of the text being typed.\n\n[font=Courier New][b]FancyTypedText.IsTextBeingTyped[/b][/font]\n[code]attribute readonly bool FancyTypedText.IsTextBeingTyped;[/code]\nTrue if a text is being typed in the FancyTypedText, and not finished.\n[/spoiler]\n\n\n[hr]\n\n[i][b]License[/b][/i]\nThis module is created by eri0o is provided with MIT License, see [url=\"https://github.com/ericoporto/fancy/blob/main/LICENSE\"]LICENSE[/url] for more details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericoporto%2Ffancy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericoporto%2Ffancy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericoporto%2Ffancy/lists"}