버전 비교

  • 이 줄이 추가되었습니다.
  • 이 줄이 삭제되었습니다.
  • 서식이 변경되었습니다.

...

  • 설명: 요소(Element)의 속성을 설정합니다. 요소(Element)마다 지원되는 속성은 다른 값을 가지고 있습니다.

  • 구문: function setProperty (‘name’,’value’);

  • 파라미터:

    name: 속성명

    value: 속성값

    지원 element

    name

    value

    유형설명

    common (단, video element는 지원하지 않음)

    width

    number

    value 단위: px

    height

    number

    value 단위: px

    left

    number

    value 단위: px

    top

    number

    value 단위: px

    visibility

    string

    value: "visible,hidden"

    opacity

    number

    value: 0.0~1.0

    rotation

    number

    value: 0~360

    size

    Object

    {width: 0, height: 0}

    position

    Object

    {left: 0, top: 0}

    image

    flip-x

    boolean

    -

    flip-y

    boolean

    -

    source

    string

    file 절대 경로(getRootDirectory()를 참조하여 생성할 수 있습니다.)

    flip

    Object

    valueObject = {x: false, y: false}

    video

    source

    string

    file 절대 경로(getRootDirectory()를 참조하여 생성할 수 있습니다.)

    text

    font-size

    number

    value: font size

    font-variant

    string

    value: normal, small-caps

    font-color

    color

    value: "rgba(0, 0, 0, 1)"

    background-color

    color

    value: "rgba(0, 0, 0, 1)"

    font-weight

    string

    value: normal, bold

    font-style

    string

    value: normal, italic

    text-decoration

    string

    value: none, line-through, underline

    letter-spacing

    number

    value 단위: 'px' (0-50)

    horizontal-align

    string

    value: left,right,center

    vertical-align

    string

    value: top,middle,bottom

    text

    string

    string

  • 반환값:

    Type: bool

    API가 성공적으로 수행된 경우: true

    API가 성공적으로 수행되지 않은 경우: false

  • 제한 사항:

    지원하지 않는 속성(파라미터의 Table에 작성되지 않은 property)을 수정할 경우, W Player 재생에 영향을 미칠 수 있습니다.

  • 코드 예제: $wp.content.getPage(pageId).getElement(‘Text1’).setProperty(‘text’, ‘Hello World!’);

  • 기타

    Image/Video 요소 - Source 속성의 파라미터는 다음과 같이 설정할 수 있습니다.

    var imagePath = $wp.local.getRootDirectory() + “/testImage.png”;

    다음을 참고하세요. ▶ $wp.local. getRootDirectory();

    $wp.content.getPage(pageId).getElement(‘Image1’).setProperty(‘source’, imagePath);

...