Added new TextEditComponent graphics.

This commit is contained in:
Aloshi 2014-03-25 18:10:35 -05:00
parent 41d8263086
commit 45428dd17b
6 changed files with 158 additions and 17 deletions

View file

@ -307,6 +307,7 @@ set(ES_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/ES_logo_32_png.cpp ${CMAKE_CURRENT_SOURCE_DIR}/data/converted/ES_logo_32_png.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/button_png.cpp ${CMAKE_CURRENT_SOURCE_DIR}/data/converted/button_png.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/button_filled_png.cpp ${CMAKE_CURRENT_SOURCE_DIR}/data/converted/button_filled_png.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/textinput_ninepatch_png.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/frame_png.cpp ${CMAKE_CURRENT_SOURCE_DIR}/data/converted/frame_png.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/scroll_gradient_png.cpp ${CMAKE_CURRENT_SOURCE_DIR}/data/converted/scroll_gradient_png.cpp

View file

@ -2,7 +2,7 @@
#include "Resources.h" #include "Resources.h"
const size_t res2hNrOfFiles = 34; const size_t res2hNrOfFiles = 35;
const Res2hEntry res2hFiles[res2hNrOfFiles] = { const Res2hEntry res2hFiles[res2hNrOfFiles] = {
{":/arrow.svg", arrow_svg_size, arrow_svg_data}, {":/arrow.svg", arrow_svg_size, arrow_svg_data},
{":/button.png", button_png_size, button_png_data}, {":/button.png", button_png_size, button_png_data},
@ -23,6 +23,7 @@ const Res2hEntry res2hFiles[res2hNrOfFiles] = {
{":/slider_knob.svg", slider_knob_svg_size, slider_knob_svg_data}, {":/slider_knob.svg", slider_knob_svg_size, slider_knob_svg_data},
{":/star_filled.svg", star_filled_svg_size, star_filled_svg_data}, {":/star_filled.svg", star_filled_svg_size, star_filled_svg_data},
{":/star_unfilled.svg", star_unfilled_svg_size, star_unfilled_svg_data}, {":/star_unfilled.svg", star_unfilled_svg_size, star_unfilled_svg_data},
{":/textinput_ninepatch.png", textinput_ninepatch_png_size, textinput_ninepatch_png_data},
{":/help/button_a.svg", help_button_a_svg_size, help_button_a_svg_data}, {":/help/button_a.svg", help_button_a_svg_size, help_button_a_svg_data},
{":/help/button_b.svg", help_button_b_svg_size, help_button_b_svg_data}, {":/help/button_b.svg", help_button_b_svg_size, help_button_b_svg_data},
{":/help/button_l.svg", help_button_l_svg_size, help_button_l_svg_data}, {":/help/button_l.svg", help_button_l_svg_size, help_button_l_svg_data},
@ -60,21 +61,22 @@ res2hMapType::value_type mapTemp[] = {
std::make_pair(":/slider_knob.svg", res2hFiles[16]), std::make_pair(":/slider_knob.svg", res2hFiles[16]),
std::make_pair(":/star_filled.svg", res2hFiles[17]), std::make_pair(":/star_filled.svg", res2hFiles[17]),
std::make_pair(":/star_unfilled.svg", res2hFiles[18]), std::make_pair(":/star_unfilled.svg", res2hFiles[18]),
std::make_pair(":/help/button_a.svg", res2hFiles[19]), std::make_pair(":/textinput_ninepatch.png", res2hFiles[19]),
std::make_pair(":/help/button_b.svg", res2hFiles[20]), std::make_pair(":/help/button_a.svg", res2hFiles[20]),
std::make_pair(":/help/button_l.svg", res2hFiles[21]), std::make_pair(":/help/button_b.svg", res2hFiles[21]),
std::make_pair(":/help/button_r.svg", res2hFiles[22]), std::make_pair(":/help/button_l.svg", res2hFiles[22]),
std::make_pair(":/help/button_select.svg", res2hFiles[23]), std::make_pair(":/help/button_r.svg", res2hFiles[23]),
std::make_pair(":/help/button_start.svg", res2hFiles[24]), std::make_pair(":/help/button_select.svg", res2hFiles[24]),
std::make_pair(":/help/button_x.svg", res2hFiles[25]), std::make_pair(":/help/button_start.svg", res2hFiles[25]),
std::make_pair(":/help/button_y.svg", res2hFiles[26]), std::make_pair(":/help/button_x.svg", res2hFiles[26]),
std::make_pair(":/help/dpad_all.svg", res2hFiles[27]), std::make_pair(":/help/button_y.svg", res2hFiles[27]),
std::make_pair(":/help/dpad_down.svg", res2hFiles[28]), std::make_pair(":/help/dpad_all.svg", res2hFiles[28]),
std::make_pair(":/help/dpad_left.svg", res2hFiles[29]), std::make_pair(":/help/dpad_down.svg", res2hFiles[29]),
std::make_pair(":/help/dpad_leftright.svg", res2hFiles[30]), std::make_pair(":/help/dpad_left.svg", res2hFiles[30]),
std::make_pair(":/help/dpad_right.svg", res2hFiles[31]), std::make_pair(":/help/dpad_leftright.svg", res2hFiles[31]),
std::make_pair(":/help/dpad_up.svg", res2hFiles[32]), std::make_pair(":/help/dpad_right.svg", res2hFiles[32]),
std::make_pair(":/help/dpad_updown.svg", res2hFiles[33]) std::make_pair(":/help/dpad_up.svg", res2hFiles[33]),
std::make_pair(":/help/dpad_updown.svg", res2hFiles[34])
}; };
res2hMapType res2hMap(mapTemp, mapTemp + sizeof mapTemp / sizeof mapTemp[0]); res2hMapType res2hMap(mapTemp, mapTemp + sizeof mapTemp / sizeof mapTemp[0]);

View file

@ -62,6 +62,9 @@ extern const unsigned char star_filled_svg_data[];
extern const size_t star_unfilled_svg_size; extern const size_t star_unfilled_svg_size;
extern const unsigned char star_unfilled_svg_data[]; extern const unsigned char star_unfilled_svg_data[];
extern const size_t textinput_ninepatch_png_size;
extern const unsigned char textinput_ninepatch_png_data[];
extern const size_t help_button_a_svg_size; extern const size_t help_button_a_svg_size;
extern const unsigned char help_button_a_svg_data[]; extern const unsigned char help_button_a_svg_data[];

View file

@ -0,0 +1,135 @@
//this file was auto-generated from "textinput_ninepatch.png" by res2h
#include "../Resources.h"
const size_t textinput_ninepatch_png_size = 1275;
const unsigned char textinput_ninepatch_png_data[1275] = {
0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,
0x00,0x0d,0x49,0x48,0x44,0x52,0x00,0x00,0x00,0x30,
0x00,0x00,0x00,0x30,0x08,0x06,0x00,0x00,0x00,0x57,
0x02,0xf9,0x87,0x00,0x00,0x00,0x19,0x74,0x45,0x58,
0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65,0x00,
0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,
0x65,0x52,0x65,0x61,0x64,0x79,0x71,0xc9,0x65,0x3c,
0x00,0x00,0x03,0x68,0x69,0x54,0x58,0x74,0x58,0x4d,
0x4c,0x3a,0x63,0x6f,0x6d,0x2e,0x61,0x64,0x6f,0x62,
0x65,0x2e,0x78,0x6d,0x70,0x00,0x00,0x00,0x00,0x00,
0x3c,0x3f,0x78,0x70,0x61,0x63,0x6b,0x65,0x74,0x20,
0x62,0x65,0x67,0x69,0x6e,0x3d,0x22,0xef,0xbb,0xbf,
0x22,0x20,0x69,0x64,0x3d,0x22,0x57,0x35,0x4d,0x30,
0x4d,0x70,0x43,0x65,0x68,0x69,0x48,0x7a,0x72,0x65,
0x53,0x7a,0x4e,0x54,0x63,0x7a,0x6b,0x63,0x39,0x64,
0x22,0x3f,0x3e,0x20,0x3c,0x78,0x3a,0x78,0x6d,0x70,
0x6d,0x65,0x74,0x61,0x20,0x78,0x6d,0x6c,0x6e,0x73,
0x3a,0x78,0x3d,0x22,0x61,0x64,0x6f,0x62,0x65,0x3a,
0x6e,0x73,0x3a,0x6d,0x65,0x74,0x61,0x2f,0x22,0x20,
0x78,0x3a,0x78,0x6d,0x70,0x74,0x6b,0x3d,0x22,0x41,
0x64,0x6f,0x62,0x65,0x20,0x58,0x4d,0x50,0x20,0x43,
0x6f,0x72,0x65,0x20,0x35,0x2e,0x33,0x2d,0x63,0x30,
0x31,0x31,0x20,0x36,0x36,0x2e,0x31,0x34,0x35,0x36,
0x36,0x31,0x2c,0x20,0x32,0x30,0x31,0x32,0x2f,0x30,
0x32,0x2f,0x30,0x36,0x2d,0x31,0x34,0x3a,0x35,0x36,
0x3a,0x32,0x37,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x22,0x3e,0x20,0x3c,0x72,0x64,0x66,0x3a,0x52,
0x44,0x46,0x20,0x78,0x6d,0x6c,0x6e,0x73,0x3a,0x72,
0x64,0x66,0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,
0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e,0x6f,0x72,
0x67,0x2f,0x31,0x39,0x39,0x39,0x2f,0x30,0x32,0x2f,
0x32,0x32,0x2d,0x72,0x64,0x66,0x2d,0x73,0x79,0x6e,
0x74,0x61,0x78,0x2d,0x6e,0x73,0x23,0x22,0x3e,0x20,
0x3c,0x72,0x64,0x66,0x3a,0x44,0x65,0x73,0x63,0x72,
0x69,0x70,0x74,0x69,0x6f,0x6e,0x20,0x72,0x64,0x66,
0x3a,0x61,0x62,0x6f,0x75,0x74,0x3d,0x22,0x22,0x20,
0x78,0x6d,0x6c,0x6e,0x73,0x3a,0x78,0x6d,0x70,0x4d,
0x4d,0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,
0x6e,0x73,0x2e,0x61,0x64,0x6f,0x62,0x65,0x2e,0x63,
0x6f,0x6d,0x2f,0x78,0x61,0x70,0x2f,0x31,0x2e,0x30,
0x2f,0x6d,0x6d,0x2f,0x22,0x20,0x78,0x6d,0x6c,0x6e,
0x73,0x3a,0x73,0x74,0x52,0x65,0x66,0x3d,0x22,0x68,
0x74,0x74,0x70,0x3a,0x2f,0x2f,0x6e,0x73,0x2e,0x61,
0x64,0x6f,0x62,0x65,0x2e,0x63,0x6f,0x6d,0x2f,0x78,
0x61,0x70,0x2f,0x31,0x2e,0x30,0x2f,0x73,0x54,0x79,
0x70,0x65,0x2f,0x52,0x65,0x73,0x6f,0x75,0x72,0x63,
0x65,0x52,0x65,0x66,0x23,0x22,0x20,0x78,0x6d,0x6c,
0x6e,0x73,0x3a,0x78,0x6d,0x70,0x3d,0x22,0x68,0x74,
0x74,0x70,0x3a,0x2f,0x2f,0x6e,0x73,0x2e,0x61,0x64,
0x6f,0x62,0x65,0x2e,0x63,0x6f,0x6d,0x2f,0x78,0x61,
0x70,0x2f,0x31,0x2e,0x30,0x2f,0x22,0x20,0x78,0x6d,
0x70,0x4d,0x4d,0x3a,0x4f,0x72,0x69,0x67,0x69,0x6e,
0x61,0x6c,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,
0x49,0x44,0x3d,0x22,0x78,0x6d,0x70,0x2e,0x64,0x69,
0x64,0x3a,0x45,0x39,0x31,0x35,0x37,0x37,0x33,0x42,
0x31,0x31,0x32,0x30,0x36,0x38,0x31,0x31,0x38,0x30,
0x38,0x33,0x43,0x37,0x45,0x33,0x31,0x45,0x41,0x35,
0x41,0x37,0x35,0x33,0x22,0x20,0x78,0x6d,0x70,0x4d,
0x4d,0x3a,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,
0x49,0x44,0x3d,0x22,0x78,0x6d,0x70,0x2e,0x64,0x69,
0x64,0x3a,0x33,0x42,0x37,0x42,0x36,0x33,0x37,0x36,
0x39,0x44,0x38,0x38,0x31,0x31,0x45,0x33,0x41,0x39,
0x31,0x44,0x42,0x44,0x46,0x44,0x34,0x30,0x39,0x39,
0x32,0x45,0x45,0x33,0x22,0x20,0x78,0x6d,0x70,0x4d,
0x4d,0x3a,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,
0x49,0x44,0x3d,0x22,0x78,0x6d,0x70,0x2e,0x69,0x69,
0x64,0x3a,0x39,0x38,0x44,0x38,0x30,0x39,0x45,0x34,
0x39,0x44,0x38,0x37,0x31,0x31,0x45,0x33,0x41,0x39,
0x31,0x44,0x42,0x44,0x46,0x44,0x34,0x30,0x39,0x39,
0x32,0x45,0x45,0x33,0x22,0x20,0x78,0x6d,0x70,0x3a,
0x43,0x72,0x65,0x61,0x74,0x6f,0x72,0x54,0x6f,0x6f,
0x6c,0x3d,0x22,0x41,0x64,0x6f,0x62,0x65,0x20,0x50,
0x68,0x6f,0x74,0x6f,0x73,0x68,0x6f,0x70,0x20,0x43,
0x53,0x36,0x20,0x28,0x4d,0x61,0x63,0x69,0x6e,0x74,
0x6f,0x73,0x68,0x29,0x22,0x3e,0x20,0x3c,0x78,0x6d,
0x70,0x4d,0x4d,0x3a,0x44,0x65,0x72,0x69,0x76,0x65,
0x64,0x46,0x72,0x6f,0x6d,0x20,0x73,0x74,0x52,0x65,
0x66,0x3a,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,
0x49,0x44,0x3d,0x22,0x78,0x6d,0x70,0x2e,0x69,0x69,
0x64,0x3a,0x45,0x39,0x31,0x35,0x37,0x37,0x33,0x42,
0x31,0x31,0x32,0x30,0x36,0x38,0x31,0x31,0x38,0x30,
0x38,0x33,0x43,0x37,0x45,0x33,0x31,0x45,0x41,0x35,
0x41,0x37,0x35,0x33,0x22,0x20,0x73,0x74,0x52,0x65,
0x66,0x3a,0x64,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,
0x49,0x44,0x3d,0x22,0x78,0x6d,0x70,0x2e,0x64,0x69,
0x64,0x3a,0x45,0x39,0x31,0x35,0x37,0x37,0x33,0x42,
0x31,0x31,0x32,0x30,0x36,0x38,0x31,0x31,0x38,0x30,
0x38,0x33,0x43,0x37,0x45,0x33,0x31,0x45,0x41,0x35,
0x41,0x37,0x35,0x33,0x22,0x2f,0x3e,0x20,0x3c,0x2f,
0x72,0x64,0x66,0x3a,0x44,0x65,0x73,0x63,0x72,0x69,
0x70,0x74,0x69,0x6f,0x6e,0x3e,0x20,0x3c,0x2f,0x72,
0x64,0x66,0x3a,0x52,0x44,0x46,0x3e,0x20,0x3c,0x2f,
0x78,0x3a,0x78,0x6d,0x70,0x6d,0x65,0x74,0x61,0x3e,
0x20,0x3c,0x3f,0x78,0x70,0x61,0x63,0x6b,0x65,0x74,
0x20,0x65,0x6e,0x64,0x3d,0x22,0x72,0x22,0x3f,0x3e,
0x18,0xec,0x12,0x45,0x00,0x00,0x01,0x29,0x49,0x44,
0x41,0x54,0x78,0xda,0xec,0x9a,0x41,0x6a,0x02,0x31,
0x18,0x85,0x7f,0x43,0xc0,0xad,0xd1,0x13,0x98,0x55,
0xb1,0x17,0xa8,0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0x9a,0x46,0x30,0xfc,0x91,0x6b,
0xc0,0x06,0x46,0x8c,0x1a,0xa4,0x6c,0x6c,0x12,0x58,
0x60,0xf6,0xe0,0x78,0x3a,0x96,0x74,0xfd,0x31,0xec,
0xf1,0x66,0x30,0xb2,0xa2,0x8b,0x4a,0xfb,0xa2,0xfd,
0xd0,0xde,0x32,0x86,0xbe,0x25,0x46,0xb0,0x56,0xca,
0xfe,0xf5,0x2d,0xc0,0x00,0x3b,0xe6,0x51,0x95,0x79,
0xeb,0x7d,0x04,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,
0x44,0xae,0x42,0x60,0x82
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -12,7 +12,7 @@
#define CURSOR_REPEAT_SPEED 28 // lower is faster #define CURSOR_REPEAT_SPEED 28 // lower is faster
TextEditComponent::TextEditComponent(Window* window) : GuiComponent(window), TextEditComponent::TextEditComponent(Window* window) : GuiComponent(window),
mBox(window, ":/button.png"), mFocused(false), mBox(window, ":/textinput_ninepatch.png"), mFocused(false),
mScrollOffset(0.0f, 0.0f), mCursor(0), mEditing(false), mFont(Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT)) mScrollOffset(0.0f, 0.0f), mCursor(0), mEditing(false), mFont(Font::get(FONT_SIZE_MEDIUM, FONT_PATH_LIGHT))
{ {
addChild(&mBox); addChild(&mBox);