{"id":18655036,"url":"https://github.com/hmlendea/nucixna.graphics","last_synced_at":"2026-04-21T10:00:46.090Z","repository":{"id":44553151,"uuid":"432715274","full_name":"hmlendea/nucixna.graphics","owner":"hmlendea","description":"Graphics management for MonoGame/XNA.","archived":false,"fork":false,"pushed_at":"2026-04-21T08:02:12.000Z","size":98,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-21T09:39:16.030Z","etag":null,"topics":["csharp","dotnet","game-development","graphics","monogame","nuget","nuget-package","xna"],"latest_commit_sha":null,"homepage":"https://nuget.org/packages/NuciXNA.Graphics","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hmlendea.png","metadata":{"files":{"readme":"README.md","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,"zenodo":null},"funding":{"github":null,"patreon":"hmlendea","open_collective":null,"ko_fi":"hmlendea","tidelift":null,"community_bridge":null,"liberapay":"HMlendea","issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"hmlendea","thanks_dev":null,"custom":"https://hmlendea.go.ro/fund.html"}},"created_at":"2021-11-28T13:08:20.000Z","updated_at":"2026-04-21T08:37:29.000Z","dependencies_parsed_at":"2024-04-04T10:26:09.977Z","dependency_job_id":"bd71b561-d3ee-4a3f-90e4-21733ae309d2","html_url":"https://github.com/hmlendea/nucixna.graphics","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/hmlendea/nucixna.graphics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fnucixna.graphics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fnucixna.graphics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fnucixna.graphics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fnucixna.graphics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmlendea","download_url":"https://codeload.github.com/hmlendea/nucixna.graphics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fnucixna.graphics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32086815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T06:27:27.065Z","status":"ssl_error","status_checked_at":"2026-04-21T06:27:21.250Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["csharp","dotnet","game-development","graphics","monogame","nuget","nuget-package","xna"],"created_at":"2024-11-07T07:17:31.749Z","updated_at":"2026-04-21T10:00:46.075Z","avatar_url":"https://github.com/hmlendea.png","language":"C#","funding_links":["https://patreon.com/hmlendea","https://ko-fi.com/hmlendea","https://liberapay.com/HMlendea","https://buymeacoffee.com/hmlendea","https://hmlendea.go.ro/fund.html"],"categories":[],"sub_categories":[],"readme":"[![Donate](https://img.shields.io/badge/-%E2%99%A5%20Donate-%23ff69b4)](https://hmlendea.go.ro/fund.html) [![Latest Release](https://img.shields.io/github/v/release/hmlendea/nucixna.graphics)](https://github.com/hmlendea/nucixna.graphics/releases/latest) [![Build Status](https://github.com/hmlendea/nucixna.graphics/actions/workflows/dotnet.yml/badge.svg)](https://github.com/hmlendea/nucixna.graphics/actions/workflows/dotnet.yml) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://gnu.org/licenses/gpl-3.0)\n\n# NuciXNA.Graphics\n\nGraphics helpers and sprite abstractions for NuciXNA, built on top of MonoGame/XNA.\n\nIt provides:\n\n- a central graphics context manager (`GraphicsManager`)\n- drawable sprite primitives (`TextSprite`, `TextureSprite`)\n- text drawing helpers with alignment and outlines\n- reusable sprite effects (movement, animation, opacity, scale, rotation)\n\n## Installation\n\n[![Get it from NuGet](https://raw.githubusercontent.com/hmlendea/readme-assets/master/badges/stores/nuget.png)](https://nuget.org/packages/NuciXNA.Graphics)\n\n### .NET CLI\n\n```bash\ndotnet add package NuciXNA.Graphics\n```\n\n### Package Manager\n```powershell\nInstall-Package NuciXNA.Graphics\n```\n\n## Requirements\n\n- .NET: `net10.0`\n- MonoGame DesktopGL (or compatible MonoGame runtime)\n- `NuciXNA.DataAccess` and `NuciXNA.Primitives` (restored automatically via NuGet)\n\n## Quick Start\n\n### 1. Initialize the graphics context\n\nIn your game setup (after creating your `GraphicsDeviceManager` and `SpriteBatch`), assign them to the shared manager:\n\n```csharp\nusing Microsoft.Xna.Framework.Graphics;\nusing NuciXNA.Graphics;\n\nGraphicsManager.Instance.Graphics = graphics;\nGraphicsManager.Instance.SpriteBatch = spriteBatch;\n```\n\n### 2. Create and load a sprite\n\n```csharp\nusing NuciXNA.Graphics.Drawing;\nusing NuciXNA.Primitives;\n\nvar label = new TextSprite\n{\n\tFontName = \"Default\",\n\tText = \"Hello NuciXNA.Graphics\",\n\tLocation = new Point2D(32, 24),\n\tSpriteSize = new Size2D(320, 64),\n\tHorizontalAlignment = Alignment.Beginning,\n\tVerticalAlignment = Alignment.Beginning,\n\tTint = Colour.White,\n\tOpacity = 1f,\n};\n\nlabel.LoadContent();\n```\n\n### 3. Update and draw in the game loop\n\n```csharp\nlabel.Update(gameTime);\n\nspriteBatch.Begin();\nlabel.Draw(spriteBatch);\nspriteBatch.End();\n```\n\n## Core Types\n\n### GraphicsManager\n\nSingleton used to expose:\n\n- `GraphicsDeviceManager Graphics`\n- `SpriteBatch SpriteBatch`\n- `BackBufferSize`\n\n### Sprite base class\n\nAll sprites derive from `Sprite` and provide:\n\n- lifecycle: `LoadContent()`, `UnloadContent()`, `Update()`, `Draw()`\n- transform/state: location, scale, rotation, tint, opacity\n- optional effects: movement, opacity, rotation, scale\n\n### TextSprite\n\nUseful for UI labels and dynamic text:\n\n- `FontName` for loading a `SpriteFont` from `Fonts/\u003cname\u003e`\n- auto text wrapping to `SpriteSize.Width`\n- horizontal/vertical alignment via `Alignment`\n- optional outlining via `FontOutline` (`None`, `Around`, `BottomRight`)\n\n### TextureSprite\n\nTexture-based sprite with optional masking and sprite-sheet animation:\n\n- `ContentFile` for texture asset path\n- `AlphaMaskFile` for alpha blending mask\n- `SourceRectangle` and `TextureLayout` (`None`, `Centre`, `Stretch`, `Tile`, `Zoom`)\n- `SpriteSheetEffect` for frame-based animation\n\n## Sprite Effects\n\nEffects inherit from `NuciSpriteEffect\u003cTSprite\u003e` and are activated at runtime.\n\nIncluded effects:\n\n- `MovementEffect` - moves the sprite toward a target location\n- `FadeEffect` - oscillates opacity between min/max multipliers\n- `ZoomEffect` - oscillates scale between min/max multipliers\n- `OscilationEffect` - oscillates rotation multiplier\n- `AnimationEffect` - advances frames for sprite sheets\n\nExample:\n\n```csharp\nusing NuciXNA.Graphics.SpriteEffects;\nusing NuciXNA.Primitives;\n\nvar sprite = new TextureSprite\n{\n\tContentFile = \"Characters/Hero\",\n\tLocation = new Point2D(120, 200),\n\tSpriteSize = new Size2D(64, 64),\n\tMovementEffect = new MovementEffect\n\t{\n\t\tSpeed = 6f,\n\t\tTargetLocation = new Point2D(320, 200),\n\t}\n};\n\nsprite.LoadContent();\nsprite.MovementEffect.Activate();\n```\n\n## Content Notes\n\n- `TextSprite` loads fonts from `Fonts/\u003cFontName\u003e` via `NuciContentManager`\n- `TextureSprite` expects valid content paths resolvable by the same content manager\n- effects and sprites must be loaded before activation, update, or draw\n\n## Development\n\n### Build\n\n```bash\ndotnet build NuciXNA.Graphics.sln\n```\n\n### Test\n\n```bash\ndotnet test NuciXNA.Graphics.sln\n```\n\n### Pack\n\n```bash\ndotnet pack NuciXNA.Graphics/NuciXNA.Graphics.csproj -c Release\n```\n\n## Contributing\n\nContributions are welcome.\n\nWhen contributing:\n\n- keep the project cross-platform\n- preserve the existing public API unless a breaking change is intentional\n- keep the changes focused and consistent with the current coding style\n- update the documentation when the behavior changes\n- include tests for any new behavior\n\n## Related Projects\n\n- [NuciXNA.DataAccess](https://github.com/hmlendea/nucixna.dataaccess)\n- [NuciXNA.Graphics](https://github.com/hmlendea/nucixna.graphics)\n- [NuciXNA.GUI](https://github.com/hmlendea/nucixna.gui)\n- [NuciXNA.Input](https://github.com/hmlendea/nucixna.input)\n- [NuciXNA.Primitives](https://github.com/hmlendea/nucixna.Primitives)\n\n## License\n\nLicensed under the GNU General Public License v3.0 or later.\nSee [LICENSE](./LICENSE) for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmlendea%2Fnucixna.graphics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmlendea%2Fnucixna.graphics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmlendea%2Fnucixna.graphics/lists"}