Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DebugKeyboard.cs
Go to the documentation of this file.
4
6
7internal class DebugKeyboard : RgbDevice
8{
9 private DebugKeyboard(Fragment fragment)
10 : base((RgbDeviceVendor)4, (RgbDeviceType)6, fragment, new DeviceColorProfile())
11 {
12 }//IL_0004: Unknown result type (might be due to invalid IL or missing references)
13 //IL_000e: Expected O, but got Unknown
14
15
16 public static DebugKeyboard Create()
17 {
18 int num = 400;
19 int num2 = 100;
20 Point[] array = new Point[num * num2];
21 for (int i = 0; i < num2; i++)
22 {
23 for (int j = 0; j < num; j++)
24 {
25 array[i * num + j] = new Point(j / 10, i / 10);
26 }
27 }
28 Vector2[] array2 = new Vector2[num * num2];
29 for (int k = 0; k < num2; k++)
30 {
31 for (int l = 0; l < num; l++)
32 {
33 array2[k * num + l] = new Vector2((float)l / (float)num2, (float)k / (float)num2);
34 }
35 }
36 return new DebugKeyboard(Fragment.FromCustom(array, array2));
37 }
38
39 public override void Present()
40 {
41 }
42
43 public override void DebugDraw(IDebugDrawer drawer, Vector2 position, float scale)
44 {
45 for (int i = 0; i < ((RgbDevice)this).LedCount; i++)
46 {
47 Vector2 ledCanvasPosition = ((RgbDevice)this).GetLedCanvasPosition(i);
48 drawer.DrawSquare(new Vector4(ledCanvasPosition * scale + position, scale / 100f, scale / 100f), new Color(((RgbDevice)this).GetUnprocessedLedColor(i)));
49 }
50 }
51}
static Fragment FromCustom(Point[] gridPositions)
Definition Fragment.cs:60
Vector4 GetUnprocessedLedColor(int index)
Definition RgbDevice.cs:47
RgbDevice(RgbDeviceVendor vendor, RgbDeviceType type, Fragment fragment, DeviceColorProfile colorProfile)
Definition RgbDevice.cs:22
override void DebugDraw(IDebugDrawer drawer, Vector2 position, float scale)
void DrawSquare(Vector4 positionAndSize, Color color)