public TextBox(int id, String text, String font, Vec2i position, Texture parent, ColorRGBA color, int resetKey, int startKey, int sendKey) : base(id, position) { this.parent = parent; //Creation: Process process = Process.ThisProcess(); thisView = zCView.Create(Process.ThisProcess(), 0, 0, 0x2000, 0x2000); setFont(font); tB = new textBox(thisView, process); tB.setText(text); tB.resetKey = resetKey; tB.startWritingKey = startKey; tB.sendKey = sendKey; tB.vt.PosX = this.position.X; tB.vt.PosY = this.position.Y; tB.SendInput += new EventHandler <EventArgs>(tbSended); tB.Inputenabled = false; setColor(color); }
private void tbSended(object obj, EventArgs args) { RakNet.BitStream stream = Program.client.sentBitStream; stream.Reset(); stream.Write((byte)DefaultMessageIDTypes.ID_USER_PACKET_ENUM); stream.Write((byte)NetworkID.GuiMessage); stream.Write((byte)GuiMessageType.TextBoxCallSend); stream.Write(Player.Hero.ID); stream.Write(this.id); stream.Write(tB.getText()); Program.client.client.Send(stream, PacketPriority.IMMEDIATE_PRIORITY, PacketReliability.RELIABLE_ORDERED, (char)0, RakNet.RakNet.UNASSIGNED_SYSTEM_ADDRESS, true); tB.setText(""); this.tB.KeyDisable(); }