Folleach / GeometryDashAPI

API for Geometry Dash
MIT License
62 stars 8 forks source link

Is there a documentation for GeometryDashAPI? #23

Closed ptbdev closed 1 year ago

ptbdev commented 1 year ago

2nd post here, I'm just curious if there is an official documentation somewhere of your GeometryDashAPI. Please let me know if there is one :)

Folleach commented 1 year ago

Hello, there is no good documentation now
I'm planning to add documentation with release 0.2, which is being prepared now

As an alternative you can see basic Examples and for combination some parts of data use a IntelliSense... You can also ask questions here or in my discord Folleach#8437

If you interested in 0.2, you can see dev branch, there are points that will go into the documentation

ptbdev commented 1 year ago

Thanks for your quick response! :0

Definitely looking forward to 0.2. Fyi I actually did look at Examples and all the code works fine for me except for one thing. GetLevelByName("level_name") is apparently an obsolete method, and I get a warning telling me to use GetLevel("level_name", revision) instead. I don't know what the 2nd parameter is supposed to mean. Could you explain? Thx

EDIT: Me and Foll DMed and according to him revision is simply the number after "rev. " if you have another level(s) with the same name. For example, say you already have a level called "Bob", if you create another one, a "Rev. 1" would appear. You would then reference the level you want to edit as Level level = new Level(local.GetLevel("Test", 1));

Folleach commented 1 year ago

Yes, it is :)

Or just call local.GetLevel("Test") it is equivalent of local.GetLevel("Test", 0) if you don't want to care about revisions

Also you can enumerate all levels with

var local = new LocalLevels();
foreach (var levelInfo in local)
{
    var level = new Level(levelInfo.LevelString, compressed: true);
    var moves = level.Blocks.Cast<MoveTrigger>().ToArray();
}
Folleach commented 1 year ago

Documentation work in progress in wiki
Links to the topics can be found in the readme