Text

Text

PIXI.Text를 조금 더 쉽게 사용하기 위해 제작된 클래스

Constructor

new Text(pixi, text, option)

PIXI.Text를 자체 생성하고 전달받은 Pixi에 등록시킨다.

기본적으로 anchor는 0.5로 가운데를 기본값으로 한다.

Parameters:
Name Type Description
pixi PIXI PIXI 오브젝트
text string 입력하고자 하는 텍스트
option object PIXI.Text와 동일한 옵션
Source:

Members

object :PIXI.Text

실제 PIXI.Text의 오브젝트
Source:

Methods

destroy()

Text 제거 함수

해당 텍스트를 PIXI 오브젝트에서 removeChild 해주고 제거한다.

Source:

setAlpha(alpha)

Text 투명도 조절 함수
Parameters:
Name Type Description
alpha number 투명도 값 0.0 ~ 1.0
Source:

setColorBasedOnBackground(backgroundRGB)

Text의 색상을 배경에 따라 white/black 으로 지정해주는 함수
Parameters:
Name Type Description
backgroundRGB array [r,g,b] 형식의 배경 rgb값
Source:

setPosition(x, y)

Text 위치 지정 함수
Parameters:
Name Type Description
x number x 좌표
y number y 좌표
Source:

setScale(scale)

Text 크기 지정 함수
Parameters:
Name Type Description
scale number 배율
Source: