Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Port Code Examples to C# (F, G, H, I, J, K, L) #43239

Merged
merged 1 commit into from
Nov 25, 2020

Conversation

HaSa1002
Copy link
Contributor

Includes:

  • File
  • Geometry2D
  • HashingContext
  • HTTPClient
  • HTTPRequest
  • Image
  • Input
  • int
  • ItemList
  • JSONParseResult
  • KinematicBody2D
  • LineEdit

There are a few things I noticed:

  1. There is no C# equivalent for PackedByteArray.hex_encode()
  2. The HTTPRequest code example doesn't work on my machine, but did so on Calinou's. I added result checking in order to provide some inside for users, when their download fails
  3. The Image.set_pixel(v) methods used variables that were never declared in order to provide minimum compilable examples
  4. The int examples are different because casting works differently
  5. The ItemList examples were executed on a string
  6. In C# there are no to_json and parse_json methods like we have in GDScript. I used JSON.Print and JSON.Parse

I stopped adding more classes to this PR, because I have to fix the MainLoop example first which requires changes to the logic and better deserves its own PR.

I compiled all examples in 3.2.3 Mono except for those that require 4.0.

doc/classes/int.xml Show resolved Hide resolved
doc/classes/KinematicBody2D.xml Outdated Show resolved Hide resolved
doc/classes/ItemList.xml Outdated Show resolved Hide resolved
doc/classes/Input.xml Outdated Show resolved Hide resolved
doc/classes/Image.xml Outdated Show resolved Hide resolved
doc/classes/Image.xml Outdated Show resolved Hide resolved
doc/classes/HashingContext.xml Outdated Show resolved Hide resolved
@HaSa1002
Copy link
Contributor Author

HaSa1002 commented Nov 1, 2020

applied code review

doc/classes/int.xml Outdated Show resolved Hide resolved
doc/classes/HashingContext.xml Outdated Show resolved Hide resolved
doc/classes/HTTPClient.xml Outdated Show resolved Hide resolved
doc/classes/File.xml Outdated Show resolved Hide resolved
@HaSa1002 HaSa1002 force-pushed the docs-lang-4 branch 3 times, most recently from 42181c4 to d9da1d3 Compare November 1, 2020 09:15
@akien-mga
Copy link
Member

Needs a rebase.

@HaSa1002
Copy link
Contributor Author

done

doc/classes/File.xml Outdated Show resolved Hide resolved
doc/classes/Geometry2D.xml Outdated Show resolved Hide resolved
doc/classes/Image.xml Outdated Show resolved Hide resolved
@aaronfranke
Copy link
Member

@HaSa1002 This looks pretty good, but it needs a rebase. If you rebase this, I will give it a ✔️

Includes:
 * File
 * Geometry2D
 * HashingContext
 * HTTPClient
 * HTTPRequest
 * Image
 * Input
 * int
 * ItemList
 * JSONParseResult
 * KinematicBody2D
 * LineEdit

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
@HaSa1002
Copy link
Contributor Author

rebased

@akien-mga akien-mga merged commit 7e009a1 into godotengine:master Nov 25, 2020
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants