Skip to content

Commit

Permalink
Rename makeResizable to handleResize
Browse files Browse the repository at this point in the history
  • Loading branch information
sajmoni committed Jun 6, 2022
1 parent 3837bb9 commit 3e72bb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ app.loader.load(() => {
scale.anchor.set(0.5)
scale.x = GAME_WIDTH / 2
scale.y = 20
ex.makeResizable(scale)
ex.handleResize(scale)

ex.useAutoFullScreen(() => {
scale.text = `Canvas will resize when window is resized. Scale: ${ex.getGameScale()}`
Expand Down Expand Up @@ -96,7 +96,7 @@ app.loader.load(() => {
},
getGlobalPositionTextContent(),
)
ex.makeResizable(globalPositionText)
ex.handleResize(globalPositionText)
square1.addChild(globalPositionText)

ex.onDrag(square1, {
Expand All @@ -108,13 +108,13 @@ app.loader.load(() => {
})

const textureIdTitle = ex.text(container, { fill: '#ffffff' }, 'Texture ids:')
ex.makeResizable(textureIdTitle)
ex.handleResize(textureIdTitle)
textureIdTitle.position.set(GAME_WIDTH - 200, 200)
textureIdTitle.anchor.set(0.5)

ex.getAllTextureIds().forEach((textureId, index) => {
const text = ex.text(container, { fill: '#ffffff' }, textureId)
ex.makeResizable(text)
ex.handleResize(text)
text.position.set(GAME_WIDTH - 200, 250 + index * 50)
text.anchor.set(0.5)
})
Expand Down
2 changes: 1 addition & 1 deletion src/modifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getGameScale } from './core'
/**
* Make it possible to resize Text using the resize function
*/
export const makeResizable = (textObject: Text): void => {
export const handleResize = (textObject: Text): void => {
const ratio = getGameScale()

// * This will break typechecking
Expand Down

0 comments on commit 3e72bb4

Please sign in to comment.