MCPcopy Create free account
hub / github.com/axmolengine/axmol / engine_inj_create_lump

Function engine_inj_create_lump

core/ui/UITextFieldEx.cpp:99–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99static Sprite* engine_inj_create_lump(const Color4B& color, int height, int width)
100{
101 unsigned int* pixels((unsigned int*)malloc(height * width * sizeof(unsigned int)));
102
103 // Fill Pixels
104 uint32_t* ptr = pixels;
105 const Color4B fillColor = Color4B::WHITE;
106 for (int i = 0; i < height * width; ++i)
107 {
108 ptr[i] = engine_inj_c4b2dw(fillColor); // 0xffffffff;
109 }
110
111 // create cursor by pixels
112 Texture2D* texture = new Texture2D();
113
114 texture->initWithData(pixels, height * width * sizeof(unsigned int), backend::PixelFormat::RGBA8, width, height);
115
116 auto cursor = Sprite::createWithTexture(texture);
117
118 cursor->setColor(Color3B(color));
119 cursor->setOpacity(color.a);
120
121 texture->release();
122
123 free(pixels);
124
125 return cursor;
126}
127
128namespace ui
129{

Callers 1

__initCursorMethod · 0.85

Calls 7

engine_inj_c4b2dwFunction · 0.85
Color3BFunction · 0.85
freeFunction · 0.50
initWithDataMethod · 0.45
setColorMethod · 0.45
setOpacityMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected