最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【C++&Live2D官方SDK】實現(xiàn)一個桌寵,附教程

2023-07-05 13:23 作者:LearningLog  | 我要投稿

void LAppDelegate::PosHandler()

{

if (_canMove)

{


POINT pt;

::GetCursorPos(&pt);

::SetWindowPos(_hw, NULL, pt.x - _deviationPoint.x, pt.y - _deviationPoint.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);

}


if (s_instance != NULL)

{

if (s_instance->_view == NULL)

{

return;

}

//鼠標坐標

POINT pos = { 0 };

GetCursorPos(&pos);

//模型坐標

RECT rect;

::GetWindowRect(_hw, &rect);

long rectX = rect.left + RenderTargetWidth * 0.5;

long rectY = rect.top + RenderTargetHeight * 0.5;


if (pos.x <= rectX)

{

pos.x = LONG(((float)pos.x / (float)rectX)*((float)RenderTargetWidth * 0.5));

}

else {

pos.x -= rectX;

pos.x = LONG(((float)pos.x / (float)(_windowWidth - rectX))*((float)RenderTargetWidth * 0.5));

pos.x += LONG((float)RenderTargetWidth * 0.5);

}

if (pos.y <= rectY)

{

pos.y = LONG(((float)pos.y / (float)rectY)*((float)RenderTargetHeight * 0.5));

}

else {

pos.y -= rectY;

pos.y = LONG(((float)pos.y / (float)(_windowHeight - rectY))*((float)RenderTargetHeight * 0.5));

pos.y += LONG((float)RenderTargetHeight * 0.5);


}

s_instance->_mouseX = pos.x;

s_instance->_mouseY = pos.y;

s_instance->_captured = true;


//LAppPal::PrintLog("[APP]tap point in pos : {x:%.2f y:%.2f}", s_instance->_mouseX, s_instance->_mouseY);

s_instance->_view->OnTouchesMoved(s_instance->_mouseX, s_instance->_mouseY);

}


}

【C++&Live2D官方SDK】實現(xiàn)一個桌寵,附教程的評論 (共 條)

分享到微博請遵守國家法律
石首市| 稷山县| 怀集县| 黄冈市| 桃园市| 洞口县| 巴中市| 卢湾区| 枣强县| 新泰市| 和田县| 宕昌县| 黎川县| 江都市| 于田县| 宜良县| 原阳县| 英德市| 万年县| 尼木县| 五河县| 南澳县| 乌兰察布市| 重庆市| 教育| 盐山县| 舟曲县| 新巴尔虎左旗| 南华县| 襄城县| 高安市| 广灵县| 封开县| 平定县| 嘉禾县| 股票| 阿图什市| 衡东县| 万山特区| 黄大仙区| 浦北县|