public GetCursorSequence ( string cursor ) : |
||
cursor | string | |
리턴 |
public void DrawRegions(WorldRenderer wr, IInputHandler inputHandler) { renderer.BeginFrame(scrollPosition, Zoom); if (wr != null) { wr.Draw(); } using (new PerfSample("render_widgets")) { Ui.Draw(); var cursorName = Ui.Root.GetCursorOuter(Viewport.LastMousePos) ?? "default"; var cursorSequence = CursorProvider.GetCursorSequence(cursorName); var cursorSprite = cursorSequence.GetSprite((int)cursorFrame); renderer.SpriteRenderer.DrawSprite(cursorSprite, Viewport.LastMousePos - cursorSequence.Hotspot, Game.modData.Palette.GetPaletteIndex(cursorSequence.Palette), cursorSprite.size); } using (new PerfSample("render_flip")) { renderer.EndFrame(inputHandler); } }
public void Render(Renderer renderer) { if (cursor.Name == null || !isLocked) { return; } var cursorSequence = cursorProvider.GetCursorSequence(cursor.Name); var cursorSprite = sprites[cursor.Name][frame]; var cursorOffset = cursorSequence.Hotspot + (0.5f * cursorSprite.Size.XY).ToInt2(); renderer.SetPalette(hardwarePalette); renderer.SpriteRenderer.DrawSprite(cursorSprite, lockedPosition - cursorOffset, paletteReferences[cursorSequence.Palette], cursorSprite.Size); }
public void Render(Renderer renderer) { if (cursorName == null) { return; } var cursorSequence = cursorProvider.GetCursorSequence(cursorName); var cursorSprite = sprites[cursorName][((int)cursorFrame % cursorSequence.Length)]; var cursorSize = CursorProvider.CursorViewportZoomed ? 2.0f * cursorSprite.Size : cursorSprite.Size; var cursorOffset = CursorProvider.CursorViewportZoomed ? (2 * cursorSequence.Hotspot) + cursorSprite.Size.XY.ToInt2() : cursorSequence.Hotspot + (0.5f * cursorSprite.Size.XY).ToInt2(); renderer.SetPalette(palette); renderer.SpriteRenderer.DrawSprite(cursorSprite, Viewport.LastMousePos - cursorOffset, paletteReferences[cursorSequence.Palette], cursorSize); }