-
Notifications
You must be signed in to change notification settings - Fork 91
Tutorial_9(en US)
MikiraSora edited this page Jan 4, 2024
·
1 revision
This SVG object is mainly divided into two types, one is an object based on .svg file (SvgImageFilePrefab); the other is an object that generates SVG objects based on text content (SvgStringPrefab).
- Get SVG content
- Parse the SVG content and get the SVG line segments their infomation about color
- Filter out inappropriate colors + corresponding line segments through object parameters
- For each group of line segments and corresponding line segments:
- 4.1 Map this color to the corresponding lane type through object parameters
- 4.2 Use different CurveInterpolaterFactory to generate line segment interpolators through object parameters, plug the line segment data into the interpolator, and obtain a series of straight lines from the latter
- 4.3 Use the above series of straight lines to generate a lane set corresponding to the lane type
- Add the output to the fumen for display
SvgImageFilePrefab:
SvgStringPrefab:
SvgPrefab general parameters:
-
ColorSimilar
: Maps the original color of the SVG object to the color that the lane can display, then this parameter indicates the fault tolerance of the color mapping. The lower the parameter value, the less content that can be converted into a lane but the more precise it is. -
CurveInterpolaterFactory
: When generating lanes and outputting them to the editor, it is necessary to convert a series of (curved) line segments of the SVG object into straight lane objects. Then this parameter option will control how the editor generates lane objects. For example, the default implementation is to directly interpolate SVG objects and then directly convert them into corresponding objects for output; if you want to implement your own custom operations (such as limiting those points The abscissas are all integer values), you can implement a plug-in containing the ICurveInterpolaterFactory by yourself -
EnableColorfulLaneSimilar
: Whether to support ColorfulLane lane when color lane mapping. If unchecked, only red, green and blue lanes will be considered. -
Opacity
: Transparency, only used to assist the display of SVG objects, and will not affect the lane output function. -
ShowOriginColor
: Whether to display the SVG object color instead of the color after color mapping. -
Tolerance
: It can be simply understood as the degree of simplification of SVG line segments. The lower the value, the closer it is to the original appearance of the SVG object. The more lane objects are generated, the longer it takes to generate lane output.
SvgStringPrefab parameters:
-
TypefaceName
: font name, for example "Consolas" -
FontSize
: There is no substantial difference between font size and Scale. FontSize is used when generating SVG objects, and Scale is used for direct scaling after generating SVG.
SvgImageFilePrefab parameters:
-
SvgFile
: Need to provide a formal .svg file
- 0. How to obtain this project application and updates
- 1. How to create a new fumen project
- 2. Prepare your editor environment
- 3. Add/select/delete/drag objects
- 4. Draw a lane (or other objects like Start/Next/End)
- 4.2 How to draw lane with curves
- 4.4. Additional options for lanes
- 5. Object Properties
- 6. Add (Wall)Tap and (Wall)Hold
- 7. Add Bell
- 8. Preview
- 9. How to add SVG objects and convert them into lanes
- 10. Load plugins and write a plugin by yourself
- 10.2 Write and run scripts
- 11. Sounds
- 12. Shortcut keys & convenient actions
- 13. File backup and rescue
- 14. How to generate game loadable .ogkr file
- 15. Detailed explanation of copy and paste logic