////////////////////////////////////////// class TransitionFill extends Transition { TransitionFill() { m_fFill = 2.0f; m_iMode = 0; } void Draw() { switch (m_iMode) { case 0: viewManager.SetViewType(2); noStroke(); fill(0); beginShape(TRIANGLES); vertex(0,0); vertex(width*(1-m_fFill),0); vertex(0,height); vertex(0,height); vertex(width*(1-m_fFill),0); vertex(width*(1-m_fFill),height); vertex(width*(1-m_fFill),0); vertex(width*2*(1-m_fFill),height/2); vertex(width*(1-m_fFill),height); endShape(); m_fFill *= 0.8; if (m_fFill <= 0.01f) { m_fFill = 1.0f; m_iMode++; } break; case 1: viewManager.SetViewType(2); noStroke(); fill(0); beginShape(TRIANGLES); vertex(width,0); vertex(width-width*(m_fFill),0); vertex(width,height); vertex(width,height); vertex(width-width*(m_fFill),0); vertex(width-width*(m_fFill),height); vertex(width-width*(m_fFill),0); vertex(width-width*2*(m_fFill),height/2); vertex(width-width*(m_fFill),height); endShape(); m_fFill *= 0.8; if (m_fFill <= 0.01f) { m_fFill = 1.0f; m_iMode++; } break; } } boolean CanTransition() { return m_iMode == 1; } boolean HasTransitioned() { return m_iMode == 2; } float m_fFill; int m_iMode; }