Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DebugKeyboard.cs
Go to the documentation of this file.
1
using
Microsoft.Xna.Framework
;
2
using
ReLogic.Graphics
;
3
using
ReLogic.Peripherals.RGB
;
4
5
namespace
Terraria.GameContent.RGB
;
6
7
internal
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
}
ReLogic.Peripherals.RGB.DeviceColorProfile
Definition
DeviceColorProfile.cs:7
ReLogic.Peripherals.RGB.Fragment.FromCustom
static Fragment FromCustom(Point[] gridPositions)
Definition
Fragment.cs:60
ReLogic.Peripherals.RGB.Fragment
Definition
Fragment.cs:7
ReLogic.Peripherals.RGB.RgbDevice.GetUnprocessedLedColor
Vector4 GetUnprocessedLedColor(int index)
Definition
RgbDevice.cs:47
ReLogic.Peripherals.RGB.RgbDevice.RgbDevice
RgbDevice(RgbDeviceVendor vendor, RgbDeviceType type, Fragment fragment, DeviceColorProfile colorProfile)
Definition
RgbDevice.cs:22
ReLogic.Peripherals.RGB.RgbDevice
Definition
RgbDevice.cs:7
Terraria.GameContent.RGB.DebugKeyboard.Create
static DebugKeyboard Create()
Definition
DebugKeyboard.cs:16
Terraria.GameContent.RGB.DebugKeyboard.DebugKeyboard
DebugKeyboard(Fragment fragment)
Definition
DebugKeyboard.cs:9
Terraria.GameContent.RGB.DebugKeyboard.DebugDraw
override void DebugDraw(IDebugDrawer drawer, Vector2 position, float scale)
Definition
DebugKeyboard.cs:43
Terraria.GameContent.RGB.DebugKeyboard.Present
override void Present()
Definition
DebugKeyboard.cs:39
Terraria.GameContent.RGB.DebugKeyboard
Definition
DebugKeyboard.cs:8
ReLogic.Graphics.IDebugDrawer.DrawSquare
void DrawSquare(Vector4 positionAndSize, Color color)
ReLogic.Graphics.IDebugDrawer
Definition
IDebugDrawer.cs:6
Microsoft.Xna.Framework
Definition
AlphaTestEffect.cs:1
ReLogic.Graphics
Definition
BasicDebugDrawer.cs:5
ReLogic.Peripherals.RGB.RgbDeviceVendor
RgbDeviceVendor
Definition
RgbDeviceVendor.cs:4
ReLogic.Peripherals.RGB.RgbDeviceType
RgbDeviceType
Definition
RgbDeviceType.cs:4
ReLogic.Peripherals.RGB
Definition
CorsairAccessMode.cs:1
Terraria.GameContent.RGB
Definition
BlizzardShader.cs:4
Microsoft.Xna.Framework.Color
Definition
Color.cs:12
Microsoft.Xna.Framework.Point
Definition
Point.cs:12
Microsoft.Xna.Framework.Vector2
Definition
Vector2.cs:12
Microsoft.Xna.Framework.Vector4
Definition
Vector4.cs:12
source
Terraria.GameContent.RGB
DebugKeyboard.cs
Generated by
1.10.0