Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

[转] 读取屏幕像素点的方法

$
0
0

@yinjimmy 写道:

auto pixelPos = CC_POINT_POINTS_TO_PIXELS(center);

cmd = new CustomCommand();

cmd->func = [=]() {
	glPixelStorei(GL_PACK_ALIGNMENT, 1);
	glReadPixels(pixelPos.x, pixelPos.y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);
};

rt->beginWithClear(0, 0, 0, 0);
spr1->visit();
_director->getRenderer()->addCommand(cmd);
rt->end();

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>