Then i pass the click to the engine, now i am getting wrong results of about 2 to 12 pixels deppending on the position of the horizontal and virtical scroll bar of the back portion, then what i do is to hide the cursor and ask the engine to draw it when the cursor passes through it. If (mx>=rendering_x & my>=rendering_y & mxGetWidth() įmy = (float(my)-rendering_y)+uv1_y*Umb::Graphics::GetDisplay()->GetHeight() Įvent->SetCoord(mx,my) /// transform click relative to black portion UmbPointerMoveEvent * event = dynamic_cast(update_frame->event) If (update_frame->event->GetType() = UmbEventType::POINTER_MOVE) Uv2.x = ImGui::GetContentRegionAvail().x / engine_screen->w +uv1.x ĮngineInbox.SetViewPortion(uv1.x,uv1.y,uv2.x,uv2.y) Uv1.y = abs(ImGui::GetWindowContentRegionMin().y)/engine_screen->h Uv1.x = abs(ImGui::GetWindowContentRegionMin().x)/engine_screen->w ImVec2 uv1,uv2 /// top left and button down range ( 0. / tell the engine the current view potion ImGui::Image((ImTextureID)GPU_GetImageHandle(engine_screen->image),ImVec2(engine_screen->w,engine_screen->h)) ImVec2 w_pos = ImGui::GetCursorPos() ,c_pos = ImGui::GetWindowPos() ĮngineInbox.SetRenderingPosition(w_pos.x+c_pos.x,w_pos.y+c_pos.y) / tell the engine the current draw position ImVec2 win_region = ImGui::GetContentRegionAvail() ĮngineInbox.SetRenderingWindowSize(win_region.x,win_region.y) / move the draw cursor to the top left corner of the window / tell the inbox if it should receive inputĮngineInbox.SetInputOn(ImGui::GetWindowIsFocused())
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |