AI SummaryCursor Rules provides UI development guidelines for a custom game engine, enforcing coding standards, folder structure, and YouTube-ready visual quality. Developers using Cursor IDE on this specific project will benefit from consistent UI implementation patterns.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to add the "cursorrules — Cursor Rules" prompt rules to my project. Repository: https://github.com/All-Out-Games/cursorrules Please read the repo to find the rules/prompt file, then: 1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type) 2. If there's an existing rules file, merge the new rules in rather than overwriting 3. Confirm what was added
Description
Any time the user requests ANY UI you must reference this documentation first.
UI Requirements
• This is a custom engine, do not attempt to use any Unity functions • Make something you would truly be proud of, do not do the bare minimum. Millions of people will see this. • This game will be recorded for YouTube, so make anything you do larger than life and pop for viewers • Make each piece of UI in a folder scripts/ui/DescriptiveName.cs • In our UI system Y grows upward. (0, 0) is the bottom left of the screen. • If you have UI that needs to set a SyncVar or other networked state, you must use a [ServerRpc] annotated function called from the client. • If you have multiple buttons make sure to push IDs! • Only ASCII characters are supported. Only use text, not emojis • When rendering icons, use .FitAspect(sprite.Aspect) so that it's not stretched • When drawing UI that follows the player, do it in LateUpdate() • Because this is mobile first, do not try to do "hover" effects or other interaction models that don't work on mobile • UI functions MUST be static and take their inputs as parameters Start all UI from UI.ScreenRect, unless it's at the edge of the screen in which case use UI.SafeRect
Rect Functions
• NEVER call new Rect() for screen space UI. Instead derive all your UI from one of the ScreenRects. • Insets cut into the rect. To avoid a rect being inversed use offset with negative values instead • You must not use any other Rect functions besides the ones in this list: public struct Rect { public Rect CenterRect() public Rect BottomRect() public Rect BottomCenterRect() ^ etc... public Rect Inset(float top, float right, float bottom, float left) public Rect Inset(float all) public Rect Grow(float top, float right, float bottom, float left) public Rect Grow(float all) public Rect Offset(float x, float y) public Rect CutTop(float pixels) public Rect CutRight(float pixels) public Rect CutBottom(float pixels) public Rect CutLeft(float pixels) public Rect InsetTop(float pixels) public Rect InsetRight(float pixels) public Rect InsetBottom(float pixels) public Rect InsetLeft(float pixels) public Rect GrowTop(float pixels) public Rect GrowRight(float pixels) public Rect GrowBottom(float pixels) public Rect GrowLeft(float pixels) public Rect Scale(float all) public Rect Scale(float x, float y) public Rect Slide(float x, float y) public Rect FitAspect(float aspect, FitAspectKind kind = FitAspectKind.Auto) } • Whenever offsetting, growing, or insetting by another Rect's dimensions, use the Unscaled versions of these functions (e.g. rect2.OffsetUnscaled(rect1.Width))
The [UIPreview] Decorator
Your boss wants to see your work to make sure you're following directions. You must structure UI code you write as a function that takes input it needs as parameters and then call it from another function annotated [UIPreview] with example data Never call Entity.Create in any function that a UIPreview calls otherwise these will pile up in the editor. For example: [UIPreview] public static void DrawNextUp() { var timeInCurrentState = Time.TimeSinceStartup % 6; DrawNextUp("Red Light, Green Light", timeInCurrentState); } public static void DrawNextUp(string title, float time) { var nextUpTexture = Assets.GetAsset<Texture>("ui/next_game_banner.png"); ... Rest of function }
Buttons
• Use one of the following assets • Do not make buttons the full height of the screen • When buttons have lots of text make sure to make them big enough "$AO/new/modal/buttons_2/button_1.png" // orange "$AO/new/modal/buttons_2/button_2.png" // green "$AO/new/modal/buttons_2/button_3.png" // red "$AO/new/modal/buttons_2/button_5.png" // blue "$AO/new/modal/buttons_2/button_7.png" // pink "$AO/new/modal/buttons_2/button_8.png" // grey "$AO/new/modal/buttons_2/button_9.png" // white
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster
Works With
Any AI assistant that accepts custom rules or system prompts