Repository navigation
Scripted Docs
arduano edited this page Jan 16, 2020
·
10 revisions
Please learn C# first before using this.
By default, the UV coordinates are set to loop (instead of clip), and filtering is nearest neighbor Can only be called from inside the Load() function
Texture LoadTexture(string path)-
Texture LoadTexture(string path, bool linear)Linear texture filtering -
Texture LoadTexture(string path, bool uvLoop, bool linear)Clipped UV coordinates
RenderQuad(double left, double top, double right, double bottom, Color4 col)RenderQuad(double left, double top, double right, double bottom, Color4 col, Texture tex)RenderQuad(double left, double top, double right, double bottom, Color4 col, Texture tex, double uvLeft, double uvTop, double uvRight, double uvBottom)RenderQuad(double left, double top, double right, double bottom, Color4 topLeft, Color4 topRight, Color4 bottomRight, Color4 bottomLeft)RenderQuad(double left, double top, double right, double bottom, Color4 topLeft, Color4 topRight, Color4 bottomRight, Color4 bottomLeft, Texture tex)RenderQuad(double left, double top, double right, double bottom, Color4 topLeft, Color4 topRight, Color4 bottomRight, Color4 bottomLeft, Texture tex, double uvLeft, double uvTop, double uvRight, double uvBottom)
RenderShape(Vector2d v1, Vector2d v2, Vector2d v3, Vector2d v4, Color4 col)RenderShape(Vector2d v1, Vector2d v2, Vector2d v3, Vector2d v4, Color4 col, Texture tex)RenderShape(Vector2d v1, Vector2d v2, Vector2d v3, Vector2d v4, Color4 col, Texture tex, Vector2d uv1, Vector2d uv2, Vector2d uv3, Vector2d uv4)RenderShape(Vector2d v1, Vector2d v2, Vector2d v3, Vector2d v4, Color4 topLeft, Color4 topRight, Color4 bottomRight, Color4 bottomLeft)RenderShape(Vector2d v1, Vector2d v2, Vector2d v3, Vector2d v4, Color4 topLeft, Color4 topRight, Color4 bottomRight, Color4 bottomLeft, Texture tex)RenderShape(Vector2d v1, Vector2d v2, Vector2d v3, Vector2d v4, Color4 topLeft, Color4 topRight, Color4 bottomRight, Color4 bottomLeft, Texture tex, Vector2d uv1, Vector2d uv2, Vector2d uv3, Vector2d uv4)
SelectTextureShader(TextureShaders shader)
This should mainly be used if you are directly interacting with OpenGL (e.g. calling GL.BlendFunc())
ForceFlushBuffer()
Due to how common this task is, it was placed in its own utility function
KeyLayout GetKeyboardLayout(int firstNote, int lastNote, KeyboardOptions options)
bool IsBlackKey(int key)
Loops over the list twice, first time returning only white notes, second time only black notes
IEnumerable<Note> BlackNotesAbove(IEnumerable<Note> notes)
Color4 BlendColors(Color4 col1, Color4 col2)
Describes a texture
{
int width; // width in pixels
int height; // height in pixels
double aspectRatio; // (width / height)
string path; // Relative file path
bool linear; // linear shading (instead of nearest neighbor)
bool looped; // looped UV coordinates
}Selects one of the 3 shaders
{
Normal, // default, multiplies colors
Inverted, // inversely multiplies (lightens) colors
Hybrid // chooses between normal and inverted, depending on if the color is < or > 0.5
}Describes settings of the renderer
{
int firstKey; // first key, from the misc page
int lastKey; // last key, from the misc page
int renderWidth; // render width in pixels (before SSAA)
int renderHeight; // render width in pixels (before SSAA)
double renderAspectRatio; // (width / height)
int renderFPS; // fps
int renderSSAA; // ssaa
double midiTime; // the current "time" position of the keyboard.
double noteScreenTime; // the note speed from the misc tab
}The generated keyboard layout from the Util.GetKeyboardLayout function
// pos
{
double left; // x coordinate of the left side
double right; // x coordinate of the right side
}
// KeyLayout
{
pos[257] keys; // positions of keys
pos[257] notes; // positions of notes
bool[257] blackKey; // boolean array with cache'd values from `Util.IsBlackKey()`
int[257] keyNumber; // cache'd numbers of each key (e.g. n'th black key, n'th white key)
}Describes options for keyboard layout, very similar to how layout in textured module works
{
bool sameWidthNotes = false;
double blackKey2setOffset = 0.3;
double blackKey3setOffset = 0.5;
double blackKeyScale = 0.6;
double blackNote2setOffset = 0;
double blackNote3setOffset = 0;
double blackNoteScale = 1;
double[5] advancedBlackKeyOffsets = new double[] { 0, 0, 0, 0, 0 };
}