‐‐ 1. Spawning - skyewontmiss/ExtendedCharts-For-CSharp GitHub Wiki

Caution: This page is under construction! Some things mentioned in this guide may not align in the actual SDK, and if it doesn't, let us know, or we might be on our way to fixing it!

Vanilla Module (Shapes, Images, Text)

This section will teach you how to spawn objects that are included with the Vanilla Module of ExtendedCharts. These include Shapes, Text, and Images, so be prepared.

Shapes

You can create a Shape using this code:

image

The 'Shape' takes in a few parameters:

_Beats: This is a float. When the Shape should spawn (in seconds).

_Name: This is a string. The name you want the Shape to have in the game scene.

_Shape: This is a string. The Shape type. The possible Shape types are:

  • Arc
  • Capsule
  • Circle
  • Diamond
  • Hexagon
  • Pentagon
  • Rounded Square
  • Square
  • Star
  • Triangle

_Position: This is a Vector3. This is where the Shape should spawn on screen.

_Rotation: This is a Vector3. This is the angle at which the Shape should spawn with.

_Scale: This is a Vector3. This is the size of which the Shape spawns with.

_Color: This is a string. This takes in a hex code (without the #) and this is the color that the Shape spawns with.

_Opacity: This is a float. From 0.0 - 1.0, this is how transparent the Shape is. 0.0 = invisible, and 1.0 = fully visible.

Example Code:

Shape exampleShape = new Shape(0.01f, "My Rounded Square", "RoundedSquare", Vector3.Zero, Vector3.Zero, Vector3.One, "626262", 1.0f);

How it shows up in game:

image

Text

As of ExtendedCharts 0.10.0, Text only shows in Bahnschrift font.

You can create some Text using this code:

image

The 'Text' takes in a few parameters:

_Beats: This is a float. When the Text should spawn (in seconds).

_Name: This is a string. The name you want the Image to have in the game scene.

_Text: This is a string. This is the text that is displayed on screen when your Text Object first spawns.

_Position: This is a Vector3. This is where the Text should spawn on screen.

_Rotation: This is a Vector3. This is the angle at which the Text should spawn with.

_Scale: This is a Vector3. This is the size of which the Text spawns with.

_Color: This is a string. This takes in a hex code (without the #) and this is the color that the Text spawns with.

_Opacity: This is a float. From 0.0 - 1.0, this is how transparent the Text is. 0.0 = invisible, and 1.0 = fully visible.

Example Code:

Text exampleText = new Text(0.01f, "My Text Object", "This is some text!", Vector3.Zero, Vector3.Zero, Vector3.One, "FFFFFF", 1.0f);

How it shows up in game:

image

Images

As of ExtendedCharts 0.10.0, images will not scale as expected, according to the Scale property. For example, an image in dimensions 100x100, and an image in dimensions 2000x2000 will NOT be the same size when the Scale property is set to 1 on all axis. You can create an Image using this code:

image

The 'Image' takes in a few parameters:

_Beats: This is a float. When the Image should spawn (in seconds).

_Name: This is a string. The name you want the Image to have in the game scene.

_Path: This is a string. This is where the image you want to load is stored. NEVER paste a full path. Only use the part of the path after the Map Folder.

For example, instead of: C:/Users/suckmynuts/Documents/Games/Poly Beats/Poly Beats_Data/StreamingAssets/Custom Maps/A Drowning Cry/Map Assets/Images/Nuts.png Ignore everything BEFORE the map folder name (which in this case is 'A Drowning Cry')

The correct Path should be this: Map Assets/Images/Nuts.png

By the way, it is recommended that you create a subfolder just for your images. To do that in VisualStudio Code, just right-click in the Explorer, and create a 'New Folder'. You should right-click on it, then press 'Reveal in File Explorer' or something, and put your images in there! Make sure you add the subfolder to your _Path though. For example, if your subfolder is called 'Balls' and you have an image in it called 'Suck Them.png', you need to do this with your path:

"Balls/Suck Them.png"

_Position: This is a Vector3. This is where the Image should spawn on screen.

_Rotation: This is a Vector3. This is the angle at which the Image should spawn with.

_Scale: This is a Vector3. This is the size of which the Image spawns with.

_Color: This is a string. This takes in a hex code (without the #) and this is the color that the Image spawns with.

_Opacity: This is a float. From 0.0 - 1.0, this is how transparent the Image is. 0.0 = invisible, and 1.0 = fully visible.

Example Code:

Image anImage = new Image(0.01f, "Poly", "assets/poly.png", Vector3.Zero, Vector3.Zero, Vector3.One, "FFFFF", 1.0f);

How it shows up in game:

image

Obligatory reminder that images will not scale as expected, according to the Scale property. For example, an image in dimensions 100x100, and an image in dimensions 2000x2000 will NOT be the same size when the Scale property is set to 1 on all axis.

Tracks Module: (Tracks)

This section will teach you how to spawn Tracks with the Tracks Module of ExtendedCharts. This is slightly more advanced, so you better be smart. Or not, I don't know what grades you got in your finals, but if I got Fs, I wouldn't be here.

Tracks

You can create a Track using this code:

image

S 'Track' takes in a few parameters:

_Beats: This is a float. When the Track should spawn (in seconds).

_Name: This is a string. The name you want the Track to have in the game scene.

_TrackToImitate: This is a string. If you want notes from a different track to also spawn on this track, you can specify so by giving the name of the Track, or leaving it as null, or at "-1".

You can reference the 5 default tracks with the strings:

  • 'S' track - "Track 1"
  • 'D' track - "Track 2"
  • 'F' track - "Track 3"
  • 'J' track - "Track 4"
  • 'K' track - "Track 5"

_Position: This is a Vector3. This is where the Track should spawn on screen. This is the only variable that uses localPosition as opposed to position. This is so that when you type `new Vector3(0, 0, 0) or an equivalent, it isn't translated to something like (-8.19, 1.05, 0.32). This is a double-edged sword, and may take trial and error to get positions correct.

The default X and Y positions of the 5 default tracks are as below. These differ per environment, so please look carefully the environment you're using for your map.

"The First" All tracks in "The First" have a Y position of 1.05.

  • 'S' track - X = -3.19
  • 'D' track - X = -1.80
  • 'F' track - X = -0.45
  • 'J' track - X = 1.36
  • 'K' track - X = 2.75

_Rotation: This is a Vector3. This is the angle at which the Track should spawn with.

_Scale: This is a Vector3. This is the size of which the Text spawns with. The default scale of Tracks are Vector3.One.

_TrackColor: This is a string. This takes in a hex code (without the #) and this is the color that the Track color is. The default value is "C1003F".

_KeyColor: This is a string. This takes in a hex code (without the #) and this is the color that the Key color is. The Key is the little box that lights up when you click the corresponding button on your controller for it. The default value is "626262".

_Opacity: This is a float. From 0.0 - 1.0, this is how transparent the Track is. 0.0 = invisible, and 1.0 = fully visible.

Example Code:

Track track = new Track(0.01f, "My Track", "Track 1", new Vector3(-7f, 0f, 0f), Vector3.Zero, Vector3.One, "0093FF", "12AF3D", 1.0f);

How it shows up in game:

image

Animation time! Skip to the next section.