public void SetSubtitle(string content, char color) { if (subtitle != null) { subtitle.Kill(); } int currentLine = 0; int longestLine = 0; for (int i = 0; i < content.Length; ++i) { if (currentLine > longestLine) { longestLine = currentLine; } if (content[i] == '\n') { currentLine = 0; } else { currentLine++; } } subtitle = AddSubView(new SHGUItext(content, 32 - (int)(longestLine / 2), 19, color)) as SHGUItext; }
public void AddTextToQueueBreakLines(string Text, float Delay, char color = 'z', int offset = 0) { SHGUItext TextView = new SHGUItext(Text, frameOffset + offset, 0, color); TextView.BreakCut(SHGUI.current.resolutionX - frameOffset, 100); queue.Add(new scrollmessage(TextView, TextView.CountLines(), Delay, false, .5f)); }
public SHGUItext AddText(string text) { SHGUItext t = new SHGUItext(text, 10, 10, 'r'); parent.AddSubView(t); return(t); }
public APPConway() : base("conway's-game-of-life-ported-by-kubazz") { //stars = new List<Vector3> (); text = AddSubView(new SHGUItext("", 1, 1, 'z')) as SHGUItext; initializeRandomBoard(); }
public APPreadme(string Label, string Content = "") { Init(); int centerX; int centerY; int halfwidth; int halfheight; centerX = (int)(SHGUI.current.resolutionX / 2); centerY = (int)(SHGUI.current.resolutionY / 2); halfwidth = 18; int lines = new SHGUItext(Content, 0, 0, 'g').CountLines(); halfheight = (int)(lines / 2 + 3); AddSubView(new SHGUIrect(0, 0, halfwidth * 2, halfheight * 2 - 1)); AddSubView(new SHGUIframe(0, 0, halfwidth * 2, halfheight * 2 - 1, 'z')); AddSubView(new SHGUItext(Label, 2, 0, 'w')); SHGUItext t = AddSubView(new SHGUItext(Content, 2, 2, 'w').BreakCut(halfwidth * 2 - 4, halfheight * 2 - 5)) as SHGUItext; for (int i = 0; i < t.text.Length; ++i) { //Debug.Log("["+t.text[i]+"]" + (int)(t.text[i])); } AddSubView(new SHGUItext("press-any-key", halfwidth * 2 - 14 - 2, halfheight * 2 - 1, 'w')); //AddSubView(new SHGUItext(c1, 1, h - 2, 'w'); x = centerX - halfwidth; y = centerY - halfheight; dontDrawViewsBelow = false; }
public void AddTextToQueueCentered(string Text, float Delay, char color = 'z') { SHGUItext TextView = new SHGUItext(Text, 0, 0, color); TextView.x = frameOffset + (int)(SHGUI.current.resolutionX / 2) - (int)(TextView.GetLineLength() / 2); queue.Add(new scrollmessage(TextView, TextView.CountLines(), Delay, false, .5f)); }
public SHGUItext GetCenteredAsciiArt(string artname, int screenPosX = 32, int screenPosY = 12) { SHGUItext t = new SHGUItext(GetASCIIartByName(artname), 1, 1, 'w') as SHGUItext; t.x = screenPosX - (int)(t.GetLineLength() / 2); t.y = screenPosY - (int)(t.CountLines() / 2); return(t); }
public APPAnt() : base("langdon-ant-ported-by-kubazz") { text = AddSubView(new SHGUItext("", 1, 1, 'w')) as SHGUItext; _origin = new Vector2((int)(Random.value * width), (int)(Random.value * height)); IsBlack = new bool[width, height]; OutOfBounds = false; }
public SHGUIguruchatwindow() { background = AddSubView(new SHGUIrect(0, 0, 0, 0, 'z')) as SHGUIrect; frameElement = AddSubView(new SHGUIframe(0, 0, 0, 0, 'z')) as SHGUIframe; labelElement = AddSubView(new SHGUItext("", 1, 0, 'z')) as SHGUItext; subElement = AddSubView(new SHGUItext("", 1, 0, 'z')) as SHGUItext; textElement = AddSubView(new SHGUIprompter(1, 1, 'w')) as SHGUIprompter; SetContent(""); }
void AddTextParticle(string text, int x, int y, char color) { SHGUIview temp = new SHGUItempview(.1f); temp.fade = 1f; SHGUItext t = new SHGUItext(text, x, y, color); temp.AddSubView(t); t.fade = 1f; AddSubView(temp); }
public void ShowChatFrames() { frame = AddSubView(new SHGUIframe(0, 0, SHGUI.current.resolutionX - 1, SHGUI.current.resolutionY - 1, 'z')); appname = AddSubView(new SHGUItext("guruCHAT", 3, 0, 'w')); chatQuitInstructions = AddSubView(new SHGUItext("", SHGUI.current.resolutionX - 22, SHGUI.current.resolutionY - 1, 'z')) as SHGUItext; clock = AddSubView(new SHGUIclock(77, 0, 'w')); frameOffset = 1; lines = 1; }
public void AddOtherQuit() { AddControlCommand("skiphere"); AddControlCommand("nolabels"); string chatEndedString = "---CHAT-ENDED---"; SHGUItext v = new SHGUItext(chatEndedString, 0, 0, 'w'); v.x = frameOffset + (int)(SHGUI.current.resolutionX / 2) - (int)(v.GetLineLength() / 2) - 1; AddMessageToQueue(new SHGUIview(), 1, 0f, false); AddMessageToQueue(v, 1, 0f, false); AddMessageToQueue(new SHGUIview(), 1, 1.75f, false); }
public SHGUIappbase(string title) { Init(); AddSubView(new SHGUIrect(0, 0, SHGUI.current.resolutionX - 1, SHGUI.current.resolutionY - 1)); APPFRAME = AddSubView(new SHGUIframe(0, 0, SHGUI.current.resolutionX - 1, SHGUI.current.resolutionY - 1, 'z')) as SHGUIframe; APPLABEL = AddSubView(new SHGUItext(title, 3, 0, 'w')) as SHGUItext; APPINSTRUCTION = AddSubView(new SHGUItext(LocalizationManager.Instance.GetLocalized("QUIT_APP_INPUT"), SHGUI.current.resolutionX - 5, SHGUI.current.resolutionY - 1, 'z').GoFromRight()) as SHGUItext; allowCursorDraw = false; overrideFadeInSpeed = .35f; overrideFadeOutSpeed = .5f; }
void AddText(string line) { var lines = line.Split(';'); string firstline = lines[0]; thisLineDelay = .8f; if (firstline.Contains(">")) { int index = firstline.IndexOf('>'); var cmd = firstline.Substring(0, index); lines[0] = firstline.Substring(index + 1); for (int i = 0; i < cmd.Length; ++i) { if (cmd[i] == 'D') { this.thisLineDelay *= 1.2f; } } } foreach (var L in text) { L.Kill(); L.remove = true; } int height = 0; foreach (var l in lines) { var t = new SHGUItext(SHGUI.current.GetASCIIartFromFont(l), 0, 0, 'w'); t.x = (int)(SHGUI.current.resolutionX / 2) - (int)(t.GetLineLength() / 2); t.y = (int)(SHGUI.current.resolutionY / 2) - (int)(t.CountLines() / 2) + height; AddSubView(t); height += (int)(SHGUI.current.resolutionY / 2) - (int)(t.CountLines() / 2) - 1; t.PunchIn(1f); text.Add(t); } foreach (var t in text) { t.y -= (int)(height / 4); } PlaySound(); }
public APPsuperhot() : base("") { //children = new List<SHGUIview>(); super = SHGUI.current.GetCenteredAsciiArt("supersmall"); AddSubView(super); super.y -= 1; super.hidden = true; hot = SHGUI.current.GetCenteredAsciiArt("hotsmall"); AddSubView(hot); hot.hidden = true; hot.y -= 1; //hot.PunchIn(1f); //super.PunchIn(1f); }
public APPscrollconsole() { //AddSubView (new SHGUIframe (0, 0, SHGUI.current.resolutionX - 1, SHGUI.current.resolutionY - 1, 'z')); messages = new List <SHGUIview>(); queue = new List <scrollmessage>(); maxlines = SHGUI.current.resolutionY - 2; instructionsAnchorX = SHGUI.current.resolutionX - 2; instructionsAnchorY = SHGUI.current.resolutionY - 1; instructions = new SHGUItext("", instructionsAnchorX, instructionsAnchorY, 'z'); AddSubView(instructions); allowCursorDraw = false; }
public void AddInteractivePrompterToQueue(string Text, string prefix = "") { SHGUItext TextView = new SHGUItext(Text, frameOffset, 0, 'w'); TextView.BreakCut(SHGUI.current.resolutionX - 2, 100); SHGUIprompter promp = new SHGUIprompter(frameOffset, 0, 'w'); promp.SetInput(Text); promp.SwitchToManualInputMode(); promp.maxLineLength = SHGUI.current.resolutionX - 2 - frameOffset; promp.maxSmartBreakOffset = 0; promp.AddPrefix(prefix); queue.Add(new scrollmessage(promp, TextView.CountLines(), 0)); }
public APPxcopy() : base("xcopy") { //stars = new List<Vector3> (); mainPhase = 0; startTime = 10; curTime = startTime; statusText = new SHGUItext("xxxxxxxx", 22, 18, 'w'); AddSubView(statusText); asciiBrain = SHGUI.current.GetASCIIartByName("Brain"); asciiCypherBrain = SHGUI.current.GetASCIIartByName("CypherBrain"); int width = 30; int textoff = 4; }
void AddFigletTextParticle(string text, int x, int y, char color) { //centered X SHGUIview temp = new SHGUItempview(.4f); int halflen = (text.Length - 1) * 3; temp.fade = 1f; SHGUItext t = new SHGUItext(SHGUI.current.GetASCIIartFromFont(text), x - halflen, y, color); temp.AddSubView(t); t.fade = 1f; AddSubView(temp); lastFigletParticle = temp; }
public SHGUIcommanderview() { Init(); left = 3; width = SHGUI.current.resolutionX - left - left - 1; buttons = new List <SHGUIcommanderbutton> (); AddSubView(new SHGUIline(left, left + width, 0, true, 'z').SetStyle("┌─┐")); AddSubView(new SHGUIline(left, left + width, SHGUI.current.resolutionY - 1, true, 'z').SetStyle("└─┘")); AddSubView(new SHGUIline(0, SHGUI.current.resolutionY - 1, left, false, 'z').SetStyle("┌│└")); AddSubView(new SHGUIline(0, SHGUI.current.resolutionY - 1, left + width, false, 'z').SetStyle("┐│┘")); AddSubView(new SHGUIline(left, left + width, SHGUI.current.resolutionY - 3, true, 'z').SetStyle("├─┤")); AddSubView(new SHGUIline(0, SHGUI.current.resolutionY - 3, left + 13, false, 'z').SetStyle("┬│┴")); AddSubView(new SHGUIline(0, SHGUI.current.resolutionY - 3, left + 22, false, 'z').SetStyle("┬│┴")); clock = AddSubView(new SHGUIclock(SHGUI.current.resolutionX - 3 - left, 0, 'w')); //AddSubView(new SHGUItext("piOS-v2.1", SHGUI.current.resolutionX - 3 - left - 8, 0, 'w').GoFromRight()); AddSubView(new SHGUItext("0mni-piOS-v2.1.01p", SHGUI.current.resolutionX - 21 - left, SHGUI.current.resolutionY - 1, 'w')); pathView = AddSubView(new SHGUItext(path, left + 1, SHGUI.current.resolutionY - 2, 'w')) as SHGUItext; listLength = SHGUI.current.resolutionY - 4; minListOffset = 1; maxListOffset = 0; /* * rightPanel = new SHGUIview (); * rightPanel.x = 25; * rightPanel.y = 1; */ /* * string content = "wlazł-kotek-na-plotek-i-"; * for (int i = 0; i < 10; ++i) { * content += content; * } */ string content = ""; rightPanelContentWidth = 32; rightPanel = AddSubView(new SHGUItext(content, left + 24, 1, 'z').BreakTextForLineLength(rightPanelContentWidth).CutTextForMaxLines(19)) as SHGUItext; //AddSubView (rightPanel); }
public void AddPrompterToQueue(string Text, float Delay, bool centered = false) { SHGUItext TextView = new SHGUItext(Text, frameOffset, 0, 'z'); TextView.BreakCut(SHGUI.current.resolutionX - 2 - frameOffset, 100); int width = TextView.GetLongestLineLength(); SHGUIprompter promp = new SHGUIprompter(frameOffset, 0, 'w'); promp.SetInput(Text); if (centered) { promp.x = (int)(SHGUI.current.resolutionX / 2) - (int)(promp.GetFirstLineLengthWithoutSpecialSigns() / 2); } promp.maxLineLength = SHGUI.current.resolutionX - 2; promp.maxSmartBreakOffset = 0; queue.Add(new scrollmessage(promp, TextView.CountLines(), Delay)); }
public APPmindcopy() : base("copy-by-SUPERHOT") { brain = SHGUI.current.GetASCIIartByName("Brain"); cypherBrain1 = SHGUI.current.GetASCIIartByName("CypherBrain1"); cypherBrain0 = SHGUI.current.GetASCIIartByName("CypherBrain0"); brainView = SHGUI.current.GetCenteredAsciiArt("Brain"); brainView.x = brainViewSideX; brainView.y = brainViewSideY; //AddSubView (brainView); cypherBrainView = SHGUI.current.GetCenteredAsciiArt("CypherBrain01"); cypherBrainView.x = cypherBrainViewSideX; cypherBrainView.y = cypherBrainViewSideY; //AddSubView (cypherBrainView); memoryFrame = new SHGUIview(); memoryFrameGlow = new SHGUIrect(-2, -2, 13, 6, 'z', ' ', 0); memoryFrameGlow.hidden = true; memoryFrame.AddSubView(memoryFrameGlow); memoryFrameItself = new SHGUIframe(-1, -1, 12, 5, 'z'); memoryFrame.AddSubView(memoryFrameItself); brainCover = new SHGUIview(); brainCoverItself = new SHGUIrect(7, 2, 18, 6, 'z', ' ', 0); //brainCoverItself = new SHGUIrect (6, 1, 19, 7, 'z', ' ', 0); brainCover.AddSubView(brainCoverItself); //brainCover.AddSubView (new SHGUIframe (6, 1, 19, 7, 'z')); phase = 0; progress = 0; APPFRAME.hidden = true; APPINSTRUCTION.hidden = true; APPLABEL.hidden = true; //Debug.Log ("brainView: " + brainView.x + ", " + brainView.y); //Debug.Log ("cypherBrainView: " + cypherBrainView.x + ", " + cypherBrainView.y); }
public APPguruchat() { Init(); allowCursorDraw = false; chats = new List <SHGUIguruchatwindow> (); frame = AddSubView(new SHGUIframe(0, 0, SHGUI.current.resolutionX - 1, SHGUI.current.resolutionY - 1, 'z')); appname = AddSubView(new SHGUItext("guruCHAT", 3, 0, 'w')); instructions = AddSubView(new SHGUItext("", SHGUI.current.resolutionX - 22, SHGUI.current.resolutionY - 1, 'w')) as SHGUItext; clock = AddSubView(new SHGUIclock(77, 0, 'w')); messageQueue = new List <gurumessage> (); //AddChatMessage ("asdfasdf", "", true); /* * SetInstructions ("WAIT-FOR-YOUR-PARTNER"); * SetInstructions ("TYPE-TO-SPEAK"); * SetInstructions ("PRESS-ENTER-TO-END-YOUR-TURN"); */ }
public void Popup(string msg, int originx, int originy, bool overrideLast = true) { if (lastPopup != null && overrideLast) { lastPopup.Kill(); } int X = camerax + originx + 2; int Y = cameray + originy; SHGUItempview pop = new SHGUItempview(.75f); SHGUIview text = new SHGUItext(msg, X, Y, 'w'); pop.AddSubView(new SHGUIrect(X, Y, X + msg.Length - 1, Y, 'z', ' ', 2)); pop.AddSubView(text); this.AddSubViewBottom(pop); lastPopup = pop; }
public void RefeshText() { try { prefix = Text.Substring(0, Text.IndexOf('│')); suffix = Text.Substring(Text.IndexOf('│') + 1, Text.Length - Text.IndexOf('│') - 1); if (suffixView == null) { suffixView = new SHGUItext(suffix, 13, 0, 'w'); AddSubView(suffixView); } else { suffixView.text = suffix; } } catch (Exception ex) { } }
public void AddTextToQueue(string Text, float Delay, char color = 'z', int offset = 0) { SHGUItext TextView = new SHGUItext(Text, frameOffset + offset, 0, color); queue.Add(new scrollmessage(TextView, TextView.CountLines(), Delay, false, .5f)); }
void DrawScore() { if (smallScore != null) { smallScore.y = 6 - guiHideOffset; } if (alive) { if (score == lastdisplayedscore) { return; } if (smallScore != null) { smallScore.KillInstant(); } smallScore = null; smallScore = new SHGUIview(); smallScore.overrideFadeInSpeed = 4f; string s = (score) + ""; if (s.Length == 2) { s = s[0] + " " + s[1]; } if (s.Length == 4) { s = s[0] + "" + s[1] + " " + s[2] + "" + s[3]; } smallScoreContent = new SHGUItext(s, 0 - (int)(s.Length / 2), 0, 'w'); smallScore.x = 32; smallScore.y = 6 - guiHideOffset; smallScore.AddSubView(new SHGUIrect(-(int)(s.Length / 2) - 2, -1, (int)(s.Length / 2) + 2, 1, 'z')); smallScore.AddSubView(new SHGUIframe(-(int)(s.Length / 2) - 2, -1, (int)(s.Length / 2) + 2, 1, 'z')); smallScore.AddSubView(smallScoreContent); AddSubView(smallScore); lastdisplayedscore = score; } else { if (bigScore == null && guiHideOffset == 40) { bigScore = new SHGUIview(); AddSubView(bigScore); //bigScore.AddSubView(new SHGUItext(SHGUI.current.GetASCIIartFromFont(score + ""), 10, 11, 'x')); //bigScore.AddSubView(new SHGUItext(SHGUI.current.GetASCIIartFromFont("DUDE DEAD"), 10, 3, 'w')); SHGUIsprite s1 = new SHGUIsprite(); s1.x = 10; s1.y = 2; s1.animationSpeed = .75f; s1.loops = true; APPtreedudeintro.TreeDudeSequence(s1, "D%T%"); bigScore.AddSubView(s1); SHGUIsprite s2 = new SHGUIsprite(); s2.x = 35; s2.y = 2; s2.loops = true; s2.animationSpeed = .75f; APPtreedudeintro.TreeDudeSequence(s2, "%DDD"); bigScore.AddSubView(s2); //score += 990; int len = (6 + score.ToString().Length) * 6 - 1; int off = (((score.ToString().Length % 2) == 0)?(1):(0)); bigScore.AddSubView(new SHGUItext(SHGUI.current.GetASCIIartFromFont("SCORE " + score), 34 - (int)(len / 2) + off, 9, 'w')); //bigScore.AddSubView(new SHGUItext(SHGUI.current.GetASCIIartFromFont(score + ""), 10, 15, 'w')); string ttt = "--PERSONAL-BEST-" + personalBest + "--"; if (score > personalBest) { personalBest = score; ttt = "--NEW-PERSONAL-BEST!-"; } SHGUIview v = new SHGUIview(); v.AddSubView(new SHGUItext(ttt, 32 - (int)(ttt.Length / 2) - 1, 15, 'w')); bigScore.AddSubView(v); SHGUIview v2 = new SHGUIblinkview(.75f); string ttt2 = "[PRESS ENTER TO RESTART]"; v2.AddSubView(new SHGUIrect(32 - (int)(ttt2.Length / 2), 20, 32 + (int)(ttt2.Length / 2) - 1, 20)); v2.AddSubView(new SHGUItext(ttt2, 32 - (int)(ttt2.Length / 2), 20, 'w')); bigScore.AddSubView(v2); } } }
public override void Update() { MoveListOffset(0); if (!pathUpdated) { pathView.text = path; pathView.CutTextForLineLength(width - 2); pathUpdated = true; } if (rightPanel.fadingIn) { rightPanel.fade += 0.2f; } base.Update(); for (int i = 0; i < buttons.Count; ++i) { buttons[i].highlighted = false; } buttons [currentButton].highlighted = true; buttons [currentButton].SpeedUpFadeIn(); if (fade < 0.99f) { return; } if (buttons[currentButton].fade > .99f && buttons[currentButton].y == minListOffset && currentListOffset < 0) { MoveListOffset(1); } if (buttons[currentButton].fade > .99f && buttons[currentButton].y == listLength) { MoveListOffset(-1); } return; //LocalizationManager.Instance if (instructions == null) { string text = LocalizationManager.Instance.GetLocalized("COMMANDER_TUTORIAL_INPUT"); instructions = AddSubView(new SHGUItext(text, SHGUI.current.resolutionX - left - 5, SHGUI.current.resolutionY - 1, 'z').GoFromRight()) as SHGUItext; } else { string text = LocalizationManager.Instance.GetLocalized("COMMANDER_TUTORIAL_INPUT"); if (text != instructions.text) { instructions.Kill(); instructions = null; instructions = AddSubView(new SHGUItext(text, SHGUI.current.resolutionX - left - 5, SHGUI.current.resolutionY - 1, 'z').GoFromRight()) as SHGUItext; } } }