Search the Community
Showing results for tags 'blendmode'.
-
Hello every one. Today i am working on raycast, and a wanted to draw key value of an entity, but unfortunately it's doesn't draw text ;( Here is a screenshot of the render: As you can see i am drawing first fps (who works) then draw the line and to finish draw keyvalue of the hit box (Fail) Here is my code: bool App::Loop() { //quit ? if (window->Closed() or window->KeyHit(Key::Escape))return false; Red->Move(); Green->Move(); Blue->Move(); world->Update(); if (window->KeyDown(Key::Right)) { camera->SetRotation(Vec3(camera->GetRotation().x, camera->GetRotation().y + 4, camera->GetRotation().z)); } //REFRESH STUFF Time::Update(); context->SetColor(0, 0, 0, 0); context->Clear(); world->Render(); //DRAW FPS context->SetBlendMode(Blend::Alpha); context->SetColor(255, 0, 0, 1); context->DrawText("FPS : " + String(Time::UPS()), 10, 20); //DRAW LINE context->SetBlendMode(Blend::Solid); context->SetColor((world->Pick(rayCastFirst, rayCastEnd, pickInfo) ? (rayCastColorOn) : (rayCastColorOff))); context->DrawLine(camera->Project(rayCastFirst).x, camera->Project(rayCastFirst).y, camera->Project(rayCastEnd).x, camera->Project(rayCastEnd).y); //set sphere to hit hitSphere->SetPosition((world->Pick(rayCastFirst, rayCastEnd, pickInfo,0,true)) ? (pickInfo.position) : (rayCastFirst) ); //if hit DRAW KEY VALUE if (world->Pick(rayCastFirst, rayCastEnd, pickInfo, 0, true)) { //fail context->SetColor(1, 1, 1, 1); context->SetBlendMode(Blend::Alpha); context->DrawText(pickInfo.entity->GetKeyValue("Color"), 20, 40); } context->Sync(true); return true; } Any reply will be appreciate ?