Found the solution here: https://www.youtube.com/watch?v=sNT8SMlqLJA1
#create 2d ortho camera
scene_ = new Scene(context_);
scene_->CreateComponent<Octree>();
// Create camera node
cameraNode_ = scene_->CreateChild("Camera");
// Set camera's position
cameraNode_->SetPosition(Vector3(0.0f, 0.0f, -10.0f));
Camera* camera = cameraNode_->CreateComponent<Camera>();
camera->SetOrthographic(true);
Graphics* graphics = GetSubsystem<Graphics>();
camera->SetOrthoSize((float)graphics->GetHeight() * PIXEL_SIZE);
// custom geometry lambda
auto triangleMan = [&](){
// classical one up
// center of screen, ortho 2d elevation
auto scp = camera->ScreenToWorldPoint(Vector3(0.5f,0.5f,-1));
triangleNode = scene_->CreateChild("triangleNode");
CustomGeometry* cg = triangleNode->CreateComponent<CustomGeometry>();
cg->Clear();
cg->SetNumGeometries(1);
cg->BeginGeometry(0, PrimitiveType::TRIANGLE_LIST);
cg->DefineVertex(Vector3(-1,0,0));
cg->DefineColor(Color::GREEN);
cg->DefineVertex(Vector3(0,1,0));
cg->DefineColor(Color::RED);
cg->DefineVertex(Vector3(1,0,0));
cg->DefineColor(Color::BLUE);
Material* mat = new Material(context_);
auto teq = cache->GetResource<Technique("Techniques/NoTextureUnlitVCol.xml");
mat->SetTechnique(0, teq);
cg->SetMaterial(mat);
mat->SetFillMode(FillMode::FILL_SOLID);
cg->Commit();
triangleNode->SetPosition(scp);
// black one down
scp = camera->ScreenToWorldPoint(Vector3(0.5f,0.5f,-1));
Node* lineNode2 = scene_->CreateChild("lineNode2");
cg = lineNode2->CreateComponent<CustomGeometry>();
cg->Clear();
cg->SetNumGeometries(1);
cg->BeginGeometry(0, PrimitiveType::TRIANGLE_LIST);
cg->DefineVertex(Vector3(1,0,0));
cg->DefineVertex(Vector3(0,-1,0));
cg->DefineVertex(Vector3(-1,0,0));
cg->DefineColor(Color::WHITE);
mat = new Material(context_);
mat->SetFillMode(FillMode::FILL_SOLID);
cg->SetMaterial(mat);
cg->Commit();
lineNode2->SetPosition(scp)
};
triangleMan();