|
4.
|
|
|
Example
|
|
|
|
예제
|
|
Translated and reviewed by
baekansi
|
|
|
|
Located in
../../source/udd.rst:25
|
|
5.
|
|
|
Here's an example of a creator-defined displayable. This displayable changes renders its child with an alpha that is determined by the distance of the mouse pointer from the center of the child. ::
|
|
|
|
다음 코드는 제작자 정의 디스플레이어블의 예제입니다. 이 코드를 쓰면 하위 위젯의 중심부로부터 마우스 포인터까지의 거리를 계산해서 하위 위젯의 알파값을 바꾸는 디스플레이어블을 만들 수 있습니다:
|
|
Translated and reviewed by
baekansi
|
|
|
|
Located in
../../source/udd.rst:27
|
|
6.
|
|
|
To use the creator-defined displayable, we can create an instance of it, and add that instance to the screen. ::
|
|
|
|
제작자 정의 디스플레이어블은 객체를 만든 후 객체를 화면에 추가하면 사용할 수 있습니다.:
|
|
Translated and reviewed by
baekansi
|
|
|
|
Located in
../../source/udd.rst:106
|
|
7.
|
|
|
renpy.Displayable
|
|
|
|
renpy.Displayable
|
|
Translated and reviewed by
baekansi
|
|
|
|
Located in
../../source/udd.rst:123
|
|
8.
|
|
|
A creator-defined displayable is created by subclassing the renpy.Displayable class. A creator-defined displayable must override the render method, and may override other methods as well.
|
|
|
|
제작자 정의 디스플레이어블은 renpy.Displayable 클래스를 상속하는 자식클래스를 이용하여 만듭니다. 제작자 정의 디스플레이어블은 render 메소드는 꼭 재작성해야 되고, 필요하다면 다른 메소드도 재작성해야 합니다.
|
|
Translated and reviewed by
baekansi
|
|
|
|
Located in
../../source/udd.rst:125
|
|
9.
|
|
|
A displayable object must be pickleable, which means it may not contain references to objects that cannot be pickled. Most notably, Render objects cannot be stored in a creator-defined displayable.
|
|
|
|
디스플레이어블 객체는 반드시 순차화할 수 있어야 합니다. 즉, 순차화할 수 없는 객체 참조는 담지 말아야 합니다. 특히 Render 객체는 제작자 정의 디스플레이어블에 저장해서는 안 됩니다.
|
|
Translated and reviewed by
baekansi
|
|
|
|
Located in
../../source/udd.rst:129
|
|
10.
|
|
|
Since we expect you to override the methods of the displayable class, we'll present them with the `self` parameter.
|
|
|
|
디스플레이어블 클래스의 메소드는 재작성해야 하니 `self` 매개변수도 함께 적어두었습니다.
|
|
Translated and reviewed by
baekansi
|
|
|
|
Located in
../../source/udd.rst:133
|
|
11.
|
|
|
Base class for creator-defined displayables.
|
|
|
|
제작자 정의 디스플레이어블의 부모 클래스입니다.
|
|
Translated and reviewed by
baekansi
|
|
|
|
Located in
../../source/udd.rst:138
|
|
12.
|
|
|
A subclass may override the constructor, perhaps adding new parameters. If it does, it should pass all unknown keyword arguments to the renpy.Displayable constructor, using code like::
|
|
|
|
자식 클래스는 생성자를 재작성하거나 새 매개변수를 더할 수도 있습니다. 그렇다면 아래 코드를 사용하여 알 수 없는 키워드 인수는 전부 renpy.Displayable 생성자에 넘겨줘야 합니다.:
|
|
Translated and reviewed by
baekansi
|
|
|
|
Located in
../../source/udd.rst:142
|
|
13.
|
|
|
Subclasses must override this, to return a :class:`renpy.Render` object. The render object determines what, if anything, is shown on the screen.
|
|
|
|
자식 클래스는 반드시 이 메소드를 재작성해서 :class:`renpy.Render` 객체를 반환해야 합니다. render 객체는 어떤 것이 화면에 나타나야 하는지를 결정하는 객체입니다.
|
|
Translated and reviewed by
baekansi
|
|
|
|
Located in
../../source/udd.rst:151
|