public FadeEvent(Camera camera, Colour start, Colour end, float duration, Trigger trigger, ObjectHouse house) : base(trigger) { m_house = house; fx_buffer.SetHUD(camera); fx_buffer.SetFading(1f/duration, start, end); }
public Text(string _text) { Contents = _text; Layer = Layer.Normal; Priority = Priority.Middle; Colour = new Colour(){A = 1}; SetSize(); }
protected ResizeableBox NewBox(Vector2f pos, Vector2f size, Colour colour) { ResizeableBox box = new ResizeableBox(m_keyboard, size, null); box.Position = pos; box.backgroundColour = colour; items.Add(box); return box; }
public static Colour Parse(string text) { Colour colour = new Colour(); float[] fVals = new float[4]; string[] components = text.Split(new []{','}); if (components.Length != 4) return colour; int i = 0; foreach (string component in components) { int iVal = int.Parse(component); if (iVal < 0 | iVal > 255) return colour; fVals[i] = iVal / 255.0f; i ++; } colour.R = fVals[0]; colour.G = fVals[1]; colour.B = fVals[2]; colour.A = fVals[3]; return colour; }
public GuiItem(UserInput keyboard, Vector2f size, Camera camera) { m_keyboard = keyboard; m_keyboard.MouseDown += MouseClicked; Size = size; backgroundColour = new Colour(1,0.4f,0.4f,0.5f); foregroundColour = new Colour(1,1,1,1); Hidden = false; if (camera != null) SetHUD(camera); Layer = Layer.Normal; Priority = Priority.Front; displayList = Gl.glGenLists(1); Gl.glNewList(1, Gl.GL_COMPILE); ConstantDraw(); Gl.glEndList(); }
public void Draw(Colour colour) { Gl.glPushMatrix(); Gl.glColor4fv(colour.Array); Gl.glBegin(Gl.GL_TRIANGLE_FAN); Gl.glVertex2f(Left, Bottom); Gl.glVertex2f(Right, Bottom); Gl.glVertex2f(Right, Top); Gl.glVertex2f(Left, Top); Gl.glEnd(); Gl.glPopMatrix(); }
public static Colour Blend(Colour one, Colour two, float level) { return one*(1-level) + two*level; }
protected ResizeableBox NewBox(BoundingBox bb, Colour colour) { ResizeableBox box = new ResizeableBox(m_keyboard, bb.Size, null); box.Bounds = bb; box.backgroundColour = colour; items.Add(box); return box; }