Skip to content

Commit

Permalink
Fixed #713: SubSystemFrame/SceneContext have toFrameContext method
Browse files Browse the repository at this point in the history
  • Loading branch information
davesmith00000 committed Apr 13, 2024
1 parent af0a068 commit 2894c58
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions indigo/indigo/src/main/scala/indigo/scenes/SceneContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ final class SceneContext[StartUpData](
*/
lazy val sceneRunning: Seconds =
frameContext.gameTime.running - sceneStartTime

def toFrameContext: FrameContext[StartUpData] =
frameContext
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ final class SubSystemFrameContext(
def bounds(sceneGraphNode: SceneNode): Rectangle =
boundaryLocator.bounds(sceneGraphNode)

def toFrameContext: FrameContext[Unit] =
new FrameContext[Unit](
gameTime,
dice,
inputState,
boundaryLocator,
()
)

}
object SubSystemFrameContext {

Expand Down

0 comments on commit 2894c58

Please sign in to comment.