public override void SetBackgroundColour(MHColour colour, MHEngine engine) { m_bgColour.Copy(colour); // Setting the background colour doesn't affect the text image but we have to // redraw it onto the display. engine.Redraw(GetVisibleArea()); }
public override void Perform(MHEngine engine) { MHObjectRef target = new MHObjectRef(); m_Target.GetValue(target, engine); // Get the item to set. MHColour newColour = new MHColour(); switch (m_ColourType) { case CT_None: { // If the colour is not specified use "transparent". newColour.SetFromString("\u0000\u0000\u0000\u00FF"); break; } case CT_Absolute: { MHOctetString colour = new MHOctetString(); m_Absolute.GetValue(colour, engine); newColour.ColStr.Copy(colour); break; } case CT_Indexed: newColour.SetFromIndex(m_Indexed.GetValue(engine)); break; } SetColour(newColour, engine); // Set the colour of the appropriate portion of the visible }
public MHLineArt() { m_OrigLineColour = new MHColour(); m_OrigFillColour = new MHColour(); m_LineColour = new MHColour(); m_FillColour = new MHColour(); m_fBorderedBBox = true; m_nOriginalLineWidth = 1; m_OriginalLineStyle = LineStyleSolid; // Colour defaults to empty. }
public MHLineArt(MHLineArt reference) : base(reference) { m_OrigLineColour = new MHColour(); m_OrigFillColour = new MHColour(); m_LineColour = new MHColour(); m_FillColour = new MHColour(); m_fBorderedBBox = reference.m_fBorderedBBox; m_nOriginalLineWidth = reference.m_nOriginalLineWidth; m_OriginalLineStyle = reference.m_OriginalLineStyle; m_OrigLineColour = reference.m_OrigLineColour; m_OrigFillColour = reference.m_OrigFillColour; }
// Return the colour, looking up in the palette if necessary. protected MHRgba GetColour(MHColour colour) { Logging.Assert(colour.ColIndex < 0); // We don't support palettes. int red = 0, green = 0, blue = 0, alpha = 0; int cSize = colour.ColStr.Size; if (cSize != 4) Logging.Log(Logging.MHLogWarning, "Colour string has length " + cSize + " not 4."); // Just in case the length is short we handle those properly. if (cSize > 0) red = colour.ColStr.GetAt(0); if (cSize > 1) green = colour.ColStr.GetAt(1); if (cSize > 2) blue = colour.ColStr.GetAt(2); if (cSize > 3) alpha = 255 - colour.ColStr.GetAt(3); // Convert transparency to alpha return new MHRgba(red, green, blue, alpha); }
public MHText() { m_nCharSet = -1; m_HorizJ = m_VertJ = Start; m_LineOrientation = Horizontal; m_StartCorner = UpperLeft; m_fTextWrap = false; m_pDisplay = null; m_OrigFont = new MHFontBody(); m_OriginalFontAttrs = new MHOctetString(); m_OriginalTextColour = new MHColour(); m_OriginalBgColour = new MHColour(); m_textColour = new MHColour(); m_bgColour = new MHColour(); m_fontAttrs = new MHOctetString(); m_Content = new MHOctetString(); }
protected string m_Path; // Path from the root directory to this application. Either the null string or // a string of the form /a/b/c . public MHApplication() { m_fIsApp = true; m_nCharSet = 0; m_nTextCHook = 0; m_nIPCHook = 0; m_nStrCHook = 0; m_nBitmapCHook = 0; m_nLineArtCHook = 0; m_pCurrentScene = null; m_nLockCount = 0; m_fRestarting = false; m_OnSpawnCloseDown = new MHActionSequence(); m_OnRestart = new MHActionSequence(); m_BGColour = new MHColour(); m_TextColour = new MHColour(); m_ButtonRefColour = new MHColour(); m_HighlightRefColour = new MHColour(); m_SliderRefColour = new MHColour(); m_Font = new MHFontBody(); m_FontAttrs = new MHOctetString(); m_DisplayStack = new MHSequence <MHVisible>(); }
public override void SetLineColour(MHColour colour, MHEngine engine) { m_LineColour.Copy(colour); engine.Redraw(GetVisibleArea()); }
public override void SetColour(MHColour colour, MHEngine engine) { Target(engine).SetFillColour(colour, engine); }
public override void SetLineColour(MHColour colour, MHEngine engine) { m_LineColour.Copy(colour); m_picture.SetLineColour(GetColour(m_LineColour)); }
public override void SetTextColour(MHColour colour, MHEngine engine) { m_textColour.Copy(colour); m_NeedsRedraw = true; engine.Redraw(GetVisibleArea()); }
public override void SetColour(MHColour colour, MHEngine engine) { Target(engine).SetBackgroundColour(colour, engine); }
public abstract void SetColour(MHColour colour, MHEngine engine);