The Filter class is the base class for filters. Filters are post-processing operations on nodes, so they inevitably operate on a renderTexture.

Filter 是滤镜基类。滤镜是针对节点的后处理过程,所以必然操作一个rendertexture

层级 (查看层级一览, 展开)

实现

属性

_filter: (
    this: RenderSprite,
    sprite: Sprite,
    context: Context,
    x: number,
    y: number,
) => void = ...

类型声明

    • (
          this: RenderSprite,
          sprite: Sprite,
          context: Context,
          x: number,
          y: number,
      ): void
    • 参数

      • this: RenderSprite

        The context in which this function is executed, typically a RenderSprite instance.

      • sprite: Sprite

        The sprite to which the filters are applied.

      • context: Context

        The current rendering context.

      • x: number

        The x-coordinate at which the sprite is being rendered.

      • y: number

        The y-coordinate at which the sprite is being rendered.

      返回 void

Applies multiple filters to a sprite within the given context.

在给定的上下文中为精灵应用多个滤镜。

访问器

方法

  • 参数

    • type: string

      The type of event.

    • 可选data: any

      (Optional) Data to pass to the callback. If multiple parameters p1, p2, p3, ... need to be passed, use an array structure such as [p1, p2, p3, ...]. If a single parameter p needs to be passed and p is an array, use a structure such as [p]. For other single parameters p, you can directly pass parameter p. If data is Event.EMPTY, it means passing an Event object to the callback function. Note that it is not passing Event.TEMP, but an independent Event object.

    返回 boolean

    True if there are listeners for this event type, false otherwise.

    Dispatch an event.

    派发事件。

  • 参数

    • type: string

      The type of event.

    返回 boolean

    True if a listener of the specified type is registered, false otherwise.

    Check if the EventDispatcher object has any listeners registered for a specific type of event.

    检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。

  • 参数

    • type: string

      The type of event.

    • listener: Function

      The listener function.

    返回 EventDispatcher

    This EventDispatcher object.

    Register an event listener object with the EventDispatcher object so that the listener receives event notifications.

    使用 EventDispatcher 对象注册指定类型的事件侦听器对象,以使侦听器能够接收事件通知。

  • 参数

    • type: string

      The type of event.

    • caller: any

      The execution scope of the event listener function.

    • listener: Function

      The listener function.

    • 可选args: any[]

      (Optional) The callback parameters of the event listener function.

    返回 EventDispatcher

    This EventDispatcher object.

    Register an event listener object with the EventDispatcher object so that the listener receives event notifications.

    使用 EventDispatcher 对象注册指定类型的事件侦听器对象,以使侦听器能够接收事件通知。

  • 参数

    • type: string

      The type of event.

    • listener: Function

      The listener function.

    返回 EventDispatcher

    This EventDispatcher object.

    Register an event listener object with the EventDispatcher object so that the listener receives event notifications. This event listener responds once and is automatically removed after the first call.

    使用 EventDispatcher 对象注册指定类型的事件侦听器对象,以使侦听器能够接收事件通知,此侦听事件响应一次后自动移除。

  • 参数

    • type: string

      The type of event.

    • caller: any

      The execution scope of the event listener function.

    • listener: Function

      The listener function.

    • 可选args: any[]

      (Optional) The callback parameters of the event listener function.

    返回 EventDispatcher

    This EventDispatcher object.

    Register an event listener object with the EventDispatcher object so that the listener receives event notifications. This event listener responds once and is automatically removed after the first call.

    使用 EventDispatcher 对象注册指定类型的事件侦听器对象,以使侦听器能够接收事件通知,此侦听事件响应一次后自动移除。

  • 参数

    • b: boolean

    返回 void

    Sets the mesh and vertex buffer to use based on whether Y-flip is needed.

    根据是否需要翻转 Y 坐标来设置使用的网格和顶点缓冲区。

MMNEPVFCICPMFPCPTTAAATR