RedGPU API - v3.0.0-Alpha
    Preparing search index...

    Class RedGPUContextSizeManager

    RedGPUContextSizeManager 클래스는 RedGPUContext의 캔버스 크기 및 렌더링 스케일을 관리합니다.

    • width, height는 픽셀(px) 또는 백분율(%)로 설정할 수 있습니다.
    • 렌더링 스케일(renderScale)은 렌더링 해상도를 조정하는 데 사용됩니다.
    • 캔버스 크기 변경 시 관련 뷰(View3D)들의 크기도 자동으로 업데이트됩니다.
    Index

    Constructors

    Accessors

    • get parentDomRect(): DOMRect

      Retrieves the rectangular dimensions of the parent DOM element of the HTML canvas.

      Returns DOMRect

      The DOMRect object representing the dimensions of the parent element.

    • get pixelRectArray(): [number, number, number, number]

      현재 width, height, renderScale 기반 렌더링될 실제 pixel(정수)단위의 Rect를 배열로 반환

      Returns [number, number, number, number]

    • get pixelRectObject(): { height: number; width: number; x: number; y: number }

      현재 width, height, renderScale 기반 렌더링될 실제 pixel(정수)단위의 Rect를 객체로 반환

      Returns { height: number; width: number; x: number; y: number }

    Methods

    • Sets the size of the element. If width and height are not provided, the current width and height values are used.

      Parameters

      • Optionalw: string | number = ...

        The new width of the element.

      • Optionalh: string | number = ...

        The new height of the element.

      Returns void

    • Calculates the size value based on the given rect object, key, and value. If the value contains a percentage sign (%), the method returns the calculated size value. If the value does not contain a percentage sign, the method returns the size value as is.

      Parameters

      • rect: { height: number; width: number; x: number; y: number }

        The rectangle object containing x, y, width, and height properties.

      • key: string

        The key corresponding to the property of the rect object that should be used for calculations.

      • value: string

        The value to calculate the size from. Can be a percentage with a % suffix or pixel value with a px suffix.

      Returns number

      • The calculated size value based on the given value and rect object.
    • Parameters

      • parentRect: ParentRect
      • key: string
      • value: string | number

      Returns number