Skip to content

Commit

Permalink
useCamera hook
Browse files Browse the repository at this point in the history
  • Loading branch information
luludotdev committed Nov 15, 2023
1 parent 1fafd89 commit dc3c7f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/react/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * from './events.ts'
export * from './inputs.ts'
export * from './network.ts'

export * from './useCamera.ts'
export * from './useForceUpdate.ts'
export * from './useGame.ts'
export * from './usePlayer.ts'
7 changes: 7 additions & 0 deletions src/react/hooks/useCamera.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { Camera } from '@dreamlab.gg/core/entities'
import { useGame } from './useGame.ts'

export const useCamera = (): Camera => {
const game = useGame()
return game.client.render.camera
}

0 comments on commit dc3c7f7

Please sign in to comment.