{"id":22075727,"url":"https://github.com/trigger-segfault/triggerstools.steinsgate","last_synced_at":"2025-07-24T12:32:20.760Z","repository":{"id":87735837,"uuid":"137611176","full_name":"trigger-segfault/TriggersTools.SteinsGate","owner":"trigger-segfault","description":"A library for generating divergence meter displays. May contain other Steins;Gate features in the future.","archived":false,"fork":false,"pushed_at":"2023-11-02T03:08:57.000Z","size":3711,"stargazers_count":25,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-09T08:43:02.039Z","etag":null,"topics":["divergence-meter","drawing","fun","steins-gate"],"latest_commit_sha":null,"homepage":"https://trigger-testing.github.io/pwa-examples/divergence-meter/","language":"C#","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/trigger-segfault.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-06-16T21:21:13.000Z","updated_at":"2024-11-05T19:17:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"f939d577-8ea4-41d4-9b29-1a216a0c03f5","html_url":"https://github.com/trigger-segfault/TriggersTools.SteinsGate","commit_stats":null,"previous_names":["trigger-death/triggerstools.steinsgate"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trigger-segfault%2FTriggersTools.SteinsGate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trigger-segfault%2FTriggersTools.SteinsGate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trigger-segfault%2FTriggersTools.SteinsGate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trigger-segfault%2FTriggersTools.SteinsGate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trigger-segfault","download_url":"https://codeload.github.com/trigger-segfault/TriggersTools.SteinsGate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227440839,"owners_count":17776660,"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":["divergence-meter","drawing","fun","steins-gate"],"created_at":"2024-11-30T22:11:05.480Z","updated_at":"2024-11-30T22:11:07.780Z","avatar_url":"https://github.com/trigger-segfault.png","language":"C#","readme":"# TriggersTools.SteinsGate\n\nA [web tool](https://trigger-testing.github.io/pwa-examples/divergence-meter/) is also available for drawing divergence meters without needing to download a program.\n\n***\n\nA .NET Standard library for generating divergence meter displays. It may contain other Steins;Gate features in the future. Drawing is done using the .NET Standard library `System.Drawing.Common`, which is available as a Nuget package.\n\n[![Discord](https://img.shields.io/discord/436949335947870238.svg?style=flat\u0026logo=discord\u0026label=chat\u0026colorB=7389DC\u0026link=https://discord.gg/vB7jUbY)](https://discord.gg/vB7jUbY)\n\n***\n\n# Divergence ![AppIcon](https://i.imgur.com/ie95bi3.png)\n\n[![NuGet Version](https://img.shields.io/nuget/v/TriggersTools.SteinsGate.Divergence.svg?style=flat)](https://www.nuget.org/packages/TriggersTools.SteinsGate.Divergence/)\n[![NuGet Downloads](https://img.shields.io/nuget/dt/TriggersTools.SteinsGate.Divergence.svg?style=flat)](https://www.nuget.org/packages/TriggersTools.SteinsGate.Divergence/)\n[![Creation Date](https://img.shields.io/badge/created-june%202018-A642FF.svg?style=flat)](https://github.com/trigger-death/TriggersTools.SteinsGate/commit/e1f8a6657c45ef51beec4babcd89226ce4874686)\n\nThe only existing feature in the library at the moment. Allows you to programatically draw [Divergence Meter](http://steins-gate.wikia.com/wiki/Divergence_Meter) nixie tubes from the visual novel \u0026 anime: [Steins;Gate](https://vndb.org/v2002).\n\n`Divergence` uses graphics taken from the Steins;Gate visual novel for drawing the tubes, digits, and decimal point. The rest of the available characters are drawn with the [Oslo II font, by Antonio Rodrigues Jr](http://www.1001fonts.com/oslo-ii-font.html). This font was chosen as it had a similar style as well as perfect aspect ratio for each character.\n\n## Basic Examples\n\nBelow is example code used to draw nixie tubes using the `Divergence` static class. At the moment, nixie tubes can be drawn at 3 pre-scaled sizes: `Large` \u003csup\u003e(132x428px per tube)\u003c/sup\u003e, `Medium` \u003csup\u003e(66x214px per tube)\u003c/sup\u003e, or `Small` \u003csup\u003e(33x107px per tube)\u003c/sup\u003e. The library currently doesn't support drawing at other scales, but that could be added later.\n\n```cs\nusing TriggersTools.SteinsGate;\n\n// Draw Figure A\nvar args = new DivergenceArgs {\n    Scale = DivergenceScale.Medium,\n    Spacing = new DivergenceSpacing(8, 8),\n    Background = Color.FromArgb(224, 224, 224),\n};\nstring text = \"Oslo II\";\nusing (Bitmap bmp = Divergence.Draw(text, args))\n    bmp.Save(\"OsloII.png\");\n\n// Draw Figure B\nargs.Scale = DivergenceScale.Small;\nargs.Spacing = new DivergenceSpacing(5, 5);\nDateTime date = DateTime.Now;\ntext = $\"{date:MM\\\\/dd\\\\/yy}\\n{date.TimeOfDay:hh\\\\:mm\\\\:ss}\";\nusing (Bitmap bmp = Divergence.Draw(text, args))\n    bmp.Save(\"DateTime.png\");\n```\n\n![Figure A + B](https://i.imgur.com/sA8IIKq.png)\n\n*(Figure B: Displaying the date and time)*\n*(Figure A: Displaying the name of the font used for all other characters)*\n\n## Backgrounds\n\nAs you can see in the code below, `DivergenceArgs.Background` accepts `string` as well. `DivergenceArgs.Background` is actually a struct called `DivergenceBackground` that can draw a background color, and/or a bitmap that is optionally scaled to fit the output image size.\n\n```cs\n// Draw Figure C\nargs = new DivergenceArgs {\n    Scale = DivergenceScale.Small,\n    Background = \"EV_Z02A.PNG\", // The CG background\n};\ntext = \"1.130426\";\nDivergence.CalculateSpacingFor(1920 / 2, 1080 / 2, text, ref args, left: 5, top: 2);\nusing (Bitmap bmp = Divergence.Draw(text, args))\n    bmp.Save(\"Original Worldline.png\");\n```\n\n![Figure C](https://i.imgur.com/MuZIeIz.png)\n\n*(Figure C: Drawing the divergence meter onto a CG to display the worldline)*\n\n## Escaping\n\nIn many scenarios, the user may not be able to pass actual new line characters if not done programmatically. `DivergenceArgs.Escape` uses the `DivergenceEscape` enum to allow 3 choices: `None` \u003csup\u003e(Don't escape anything)\u003c/sup\u003e, `NewLines` \u003csup\u003e(Only escape \\r and \\n)\u003c/sup\u003e, and `All` \u003csup\u003e(Escape any character after '\\\\')\u003c/sup\u003e.\n\nAn example would be in the command line: `divergence.exe \"#1\\n#2\"`. (Note: No command line program exists for this library at the moment.)\n\n![Figure D](https://i.imgur.com/tEnTLVQ.png)\n\n*(Figure D: The supposed output from the command line example above)*\n\n## Example use of this library\n\n`Divergence` isn't extremely useful or anything, but it can be fun to use as a bot command. Some of the features were specifically designed for use with an automated system.\n\n```cs\n// Automatically throw an ArgumentException if a formatted line\n// is longer than 24 characters or there are more than 3 lines.\nDivergence.EnabledLimits = true;\nDivergence.MaxLength = 24;\nDivergence.MaxLines = 3;\n```\n\n![Figure E](https://i.imgur.com/Ls2YRMl.png)\n\n*(Figure E: The '\\\\' before the space is used to escape it so that it is included in the command)*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrigger-segfault%2Ftriggerstools.steinsgate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrigger-segfault%2Ftriggerstools.steinsgate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrigger-segfault%2Ftriggerstools.steinsgate/lists"}