Beispiel #1
0
bool Text::unpersist(InputPersistenceBlock &reader) {
	bool result = true;

	result &= RenderObject::unpersist(reader);

	// Read color and alpha
	reader.read(_modulationColor);

	// Run all methods on loading relevant members.
	// So, the layout is automatically updated and all necessary logic is executed.

	Common::String font;
	reader.readString(font);
	setFont(font);

	Common::String text;
	reader.readString(text);
	setText(text);

	bool autoWrap;
	reader.read(autoWrap);
	setAutoWrap(autoWrap);

	uint32 autoWrapThreshold;
	reader.read(autoWrapThreshold);
	setAutoWrapThreshold(autoWrapThreshold);

	result &= RenderObject::unpersistChildren(reader);

	return reader.isGood() && result;
}
Beispiel #2
0
bool Text::unpersist(InputPersistenceBlock &reader) {
	bool result = true;

	result &= RenderObject::unpersist(reader);

	// Farbe und Alpha einlesen.
	reader.read(_modulationColor);

	// Beim Laden der anderen Member werden die Set-Methoden benutzt statt der tatsächlichen Member.
	// So wird das Layout automatisch aktualisiert und auch alle anderen notwendigen Methoden ausgeführt.

	Common::String font;
	reader.readString(font);
	setFont(font);

	Common::String text;
	reader.readString(text);
	setText(text);

	bool autoWrap;
	reader.read(autoWrap);
	setAutoWrap(autoWrap);

	uint autoWrapThreshold;
	reader.read(autoWrapThreshold);
	setAutoWrapThreshold(autoWrapThreshold);

	result &= RenderObject::unpersistChildren(reader);

	return reader.isGood() && result;
}