MCPcopy Create free account
hub / github.com/devkitPro/3ds-hbmenu / menuDrawEntry

Function menuDrawEntry

source/ui/menu.c:274–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274float menuDrawEntry(menuEntry_s* me, float x, float y, bool selected)
275{
276 float bubbleWidth = g_imageData[images_appbubble_idx].width;
277 float bubbleHeight = g_imageData[images_appbubble_idx].height;
278
279 float height = bubbleHeight + 4.0f;
280 if (selected)
281 {
282 height += 4.0f;
283 x -= 4.0f;
284 }
285
286 if ((y+height) <= 0.0f || y >= 240.f)
287 return height;
288
289 if (selected)
290 drawingDrawImage(images_appbubble_idx, 0x80808080, x, y+4);
291 drawingDrawImage(images_appbubble_idx, !me->isStarred ? 0xFFFFFFFF : 0xFFD0FFFF, x, y);
292
293 if (me->icon)
294 {
295 drawingWithTex(me->icon, 0xFFFFFFFF);
296 drawingDrawQuad(x+8, y+8, 48, 48);
297 } else if (me->type == ENTRY_TYPE_FOLDER)
298 drawingDrawImage(images_folderIcon_idx, 0xFFFFFFFF, x+8, y+8);
299 else
300 drawingDrawImage(images_defaultIcon_idx, 0xFFFFFFFF, x+8, y+8);
301
302 if (me->isStarred)
303 {
304 float starWidth = g_imageData[images_star_idx].width;
305 float starHeight = g_imageData[images_star_idx].height;
306 drawingDrawImage(images_star_idx, 0xFFFFFFFF, x - 0.25f*starWidth, y+bubbleHeight-0.75*starHeight);
307 }
308
309 textSetColor(0xFF545454);
310 textDrawInBox(me->name, -1, 0.5f, 0.5f, y+20, x+66, x+bubbleWidth-8);
311 textDrawInBox(me->description, -1, 0.4f, 0.4f, y+35, x+66+4, x+bubbleWidth-8);
312 textDrawInBox(me->author, 1, 0.4f, 0.4f, y+bubbleHeight-6, x+66, x+bubbleWidth-8);
313
314 return height;
315}
316
317static float calcScrollbarKnobPos(menu_s* menu, float totalHeight)
318{

Callers 2

menuDrawBotFunction · 0.85
titleSelectDrawBotFunction · 0.85

Calls 5

drawingDrawImageFunction · 0.85
drawingWithTexFunction · 0.85
drawingDrawQuadFunction · 0.85
textSetColorFunction · 0.85
textDrawInBoxFunction · 0.85

Tested by

no test coverage detected