guiapppassword.cpp

来自「老外为HGE写的扩展GUI」· C++ 代码 · 共 26 行

CPP
26
字号
#include "guiapppassword.h"

GUIAppPassword::GUIAppPassword(int id, float x, float y, float w, hgeFont *fnt, char* str ) : GUIAppEdit(id, x, y, w, fnt, str ) {
}

void GUIAppPassword::Render() {
	hge->Gfx_RenderLine(rect.x1, rect.y1, rect.x2, rect.y1, frameColor);
	hge->Gfx_RenderLine(rect.x2, rect.y1, rect.x2, rect.y2, frameColor);
	hge->Gfx_RenderLine(rect.x2, rect.y2, rect.x1, rect.y2, frameColor);
	hge->Gfx_RenderLine(rect.x1, rect.y2, rect.x1, rect.y1, frameColor);
	
	m_Font->SetColor(textColor);
	char tmpstr[1024];
	memset(tmpstr,'*',strlen(m_Text));
	tmpstr[strlen(m_Text)] = 0;
	m_Font->Render(rect.x1 + 2, rect.y1 + 2, tmpstr);
	
	if (m_Focus && m_Blink) {
		char tmp[1024]; 
		strncpy(tmp, tmpstr, m_Pos);
		tmp[m_Pos] = 0;
		
		float p = m_Font->GetStringWidth(tmp);
		hge->Gfx_RenderLine(rect.x1 + 2 + p, rect.y1 + 2, rect.x1 + 2 + p, rect.y2 - 2, 0xFFFFFFFF);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?