Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SpectralDragon committed Jun 1, 2024
1 parent 294ec76 commit 6775a5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AdaEngine

@MainActor
func makeScene() async throws -> Scene {
let scene = Scene()
try self.makePlayer(for: scene)
class PlayerAndTextScene: Scene {
override func sceneDidMove(to view: SceneView) {
try self.makePlayer(for: self)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}

@Step {
We must add our player to the scene. To do this we will use Entity and a couple of helper functions. Follow the code!
We must add our player to the scene. To do this we will use ``Entity`` and a couple of helper functions. Follow the code!

We will create a separate makePlayer function for our scene where we will add various components.

Expand Down Expand Up @@ -48,7 +48,7 @@

@Step {

After all the preparations, let's call our function in makeScene
After all the preparations, let's call our function in ``Scene\sceneDidMove(to:)``

@Code(name: "MakePlayer.swift", file: PAT-1-6-makeScene.swift)
}
Expand All @@ -68,7 +68,7 @@
}

@Step {
By analogy with the player, we will create a separate function for adding glasses text to the scene. Here, we also create an Entity, add a Text2DComponent to it - it will help us draw the text. We add our GameState to take updated values ​​from the state and add Transform.
By analogy with the player, we will create a separate function for adding glasses text to the scene. Here, we also create an ``Entity``, add a ``Text2DComponent`` to it - it will help us draw the text. We add our GameState to take updated values ​​from the state and add Transform.

To customize the text, you can use TextAttributeContainer.

Expand Down

0 comments on commit 6775a5c

Please sign in to comment.