首页 > 文档 > cursor()鼠标指针样式
2017
07-01

cursor()鼠标指针样式

  1. cursor()

Name名称):cursor()//鼠标指针样式

Examples例子):

// Move the mouse left and right across the image

//移动鼠标从左图到右图

// to see the cursor change from a cross to a hand

//看到鼠标光标从一个十字变成一只手

void draw()

{  if (mouseX < 50) {

    cursor(CROSS);

    } else {

                cursor(HAND);

  }}

 

Description描述):Sets the cursor to a predefined symbol or an image, or makes it visible if already hidden. If you are trying to set an image as the cursor, the recommended size is 16×16 or 32×32 pixels. It is not possible to load an image as the cursor if you are exporting your program for the Web, and not all MODES work with all browsers. The values for parameters x and y must be less than the dimensions of the image.

将光标设置为预定义的符号或图像,或使其可见,如果已经隐藏。如果您试图将图像设置为游标,建议的大小为16×16或32×32像素。如果您正在向Web导出程序,而不是所有的模式都与所有浏览器一起工作,则不可能将图像加载为游标。参数x和y的值必须小于图像的尺寸。

Setting or hiding the cursor does not generally work with “Present” mode (when running full-screen).

设置或隐藏光标通常不会与“当前”模式(在运行全屏时)工作。

 

With the P2D and P3D renderers, a generic set of cursors are used because the OpenGL renderer doesn’t have access to the default cursor images for each platform (Issue 3791).

使用P2D和P3D渲染器,使用一组通用的游标,因为OpenGL渲染器无法访问每个平台的默认光标图像。

Syntax(语法):cursor(kind)

cursor(img)

cursor(img, x, y)

cursor()

Parameters (参数):kind——ARROW(箭头), CROSS(十字架), HAND(), MOVE(移动),   TEXT(文字),WAIT等待

Img——any variable of type PImage(任何类型PImage的变量

X—— the horizontal active spot of the cursor(光标的水平活动点

Y——the vertical active spot of the cursor(光标的垂直活动点

Returns返回值):Void(

Related相关函数):noCursor()

 

 



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。