surface_copy_part()


2D グラフィック機能

surface_copy_part

Copies part of a source surface onto a destination surface (without any form of blending.)

Syntax:

surface_copy_part(destination, x, y, source, xs, ys, ws, hs);
destination
コピー先のサーフェースのインデックス番号
x
描画左上座標(X)
y
描画左上座標(Y)
source
コピー元のサーフェースのインデックス番号
xs
切り取り左上座標(X)
ys
切り取り左上座標(Y)
ws
切り取る幅
hs
切り取る高さ

戻り値

N/A
なし

Description

This function simply takes the image from one surface and copies it onto another one at the specified local position within that surface (where the (0,0) position is the top left corner of the destination surface). You can specify a local x and y position to copy from as well as the width and height of the section. Please note that these are coordinates based on the surface size and not on the position at which the surface is being drawn in the room (see the main page on Surfaces for further information). If the destination surface already has information this will be over-written by the copy, and the function does not change the source surface in any way.

注意

サーフェースはいつでも破棄される可能性があります。ですのでsurface_exists()関数を使用して常に存在チェックをする必要があります。詳細についてはサーフェース機能についてを参照してください


Example:

if view_current == 0
{
  view_copy(surf, 0, 0, 0, 0, view_xview[1] - mouse_x, view_yview[1] - mouse-y, temp_surf);
}
else
{
  draw_surface(surf, 0, 0);
}

The above code will check the current view being drawn and if it is view[0] it copies the surface indexed in the variable "temp_surf" onto the surface indexed in the variable "surf". the area copied corresponds to a rectangle formed by the relative position of the mouse within the surface as it would be drawn in view[1]. If the current view is anything other than view[0] the surface "surf" is drawn to the screen.

Wiki内検索

#search(): You already view a search box

MENU

ドキュメント

GMLリファレンス

2ch

その他



最新の30件

2024-03-07 2023-08-09 2023-05-21 2023-05-20 2023-05-04 2022-10-13 2022-07-21 2022-07-02 2022-04-06 2021-11-30 2021-11-26 2021-10-03 2021-09-23 2021-08-15 2021-06-02 2021-01-23 2021-01-21 2021-01-19 2021-01-18 2021-01-16 2021-01-15

人気の10件

今日の10件



これまでの訪問者: 1028
今日の訪問者: 2
昨日の訪問者: 1
閲覧者: 3