Index of every page on this site: llms.txt
All skills
jame581 avatar

/responsive-ui

@426e8ab
by Jan Mesarčjame581/godotprompter979 stars
63
Run it yourself

Use when handling multiple resolutions — stretch modes, aspect ratios, DPI scaling, and mobile/desktop adaptation

Use this Skill: https://skilld.dev/gh/jame581/godotprompter/responsive-ui

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencespixel-art-setup.md

≈606 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Pixel Art Setup

Reference for skills/responsive-ui/SKILL.md — project settings for pixel art, integer scaling via script, nearest-neighbour filter overrides.

← Back to SKILL.md


4. Pixel Art Setup

Project Settings

In Project > Project Settings:

  • Display > Window > Stretch > Mode → viewport
  • Display > Window > Stretch > Scale Mode → integer (leave Scale at 1 — in viewport mode a scale of 2 halves the internal resolution)
  • Rendering > Textures > Canvas Textures > Default Texture Filter → Nearest

Setting the texture filter to Nearest globally avoids blurry pixels without per-sprite configuration.

Integer Scaling via Script

GDScript:

# res://autoload/display_manager.gd
extends Node

const BASE_SIZE := Vector2i(320, 180)  # pixel art design resolution

func _ready() -> void:
    var window := get_window()
    window.content_scale_size = BASE_SIZE
    window.content_scale_mode = Window.CONTENT_SCALE_MODE_VIEWPORT
    window.content_scale_aspect = Window.CONTENT_SCALE_ASPECT_KEEP
    # Scale by the largest whole multiple that fits the window; the rest is letterboxed.
    # Recomputed by the engine on every resize. Do not use content_scale_factor for this:
    # in viewport mode it divides the render resolution (a factor of 4 renders 80x45).
    window.content_scale_stretch = Window.CONTENT_SCALE_STRETCH_INTEGER

C#:

// autoload/DisplayManager.cs
using Godot;

public partial class DisplayManager : Node
{
    private static readonly Vector2I BaseSize = new(320, 180);

    public override void _Ready()
    {
        var window = GetWindow();
        window.ContentScaleSize    = BaseSize;
        window.ContentScaleMode    = Window.ContentScaleModeEnum.Viewport;
        window.ContentScaleAspect  = Window.ContentScaleAspectEnum.Keep;
        // Largest whole multiple that fits; recomputed by the engine on every resize.
        window.ContentScaleStretch = Window.ContentScaleStretchEnum.Integer;
    }
}

Nearest-Neighbour Filter per Node (Override)

If the global filter is Linear and you only want Nearest on specific sprites:

GDScript:

# On a Sprite2D or TextureRect node
$Sprite2D.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST

C#:

GetNode<Sprite2D>("Sprite2D").TextureFilter = CanvasItem.TextureFilterEnum.Nearest;

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts29d3 checks · Risk SAFE
  • Gen Agent Trust Hub29d

    The skill provides comprehensive documentation and code snippets for creating responsive user interfaces in Godot 4.3+. It covers project settings, DPI scaling, mobile safe areas, and pixel art configurations. No security issues were detected.

  • Socket29d

    No alerts

  • Snyk29d

    Risk: LOW · No issues

Signed by skilld at 426e8ab. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated last month

README badge

README badge for jame581/godotprompter/responsive-ui