Skip to content

Instantly share code, notes, and snippets.

using HarmonyLib;
using RimWorld;
using RWLayout.alpha2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VRage.Game.ModAPI.Ingame;
namespace Script
{
#region ingame script start
// PBDiagnostics
// Simple tool to manipulate programmable block's Storage variable.
ParamsRouter paramsRouter;
public Program()
{
IsolatedRun(() =>
{
@krypt-lynx
krypt-lynx / vartical_label.cs
Last active November 20, 2022 03:45
Unity imgui vertical label
public void VerticalLabel(Rect rect, Vector2 clipSize, string text)
{
// the issue:
// while we transforming gui, whe clip area rotates with it
// so, if we want to draw somewhere on untrasformed screen, we have invalid clip area to deal with.
// the best idea I have is to draw on (0,0) of current clip area and move label to desized position using gui matrix intead of label coordinates
// limitations:
// we need to apply clip effect to transformed label manually, we need to know clip area size for that, but I see no way to obrain it
// original clip is still applied, and width and height is now inverted. So, original clip have no space to render the label *horizontaly*, the vertical label will not be rendered correctly either.