# Sprites, Button Images and Callback Actions

**URL:** <https://forum.babylonjs.com/t/sprites-button-images-and-callback-actions/45503>\
**Category:** Questions\
**Created:** [November 6, 2023, 11:19pm UTC](https://forum.babylonjs.com/t/sprites-button-images-and-callback-actions/45503 "2023-11-06T23:19:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![docEdub](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/docedub/32/14525_2.png) [@docEdub](https://forum.babylonjs.com/u/docEdub)\
**Post date:** [November 7, 2023, 3:58am UTC](https://forum.babylonjs.com/t/sprites-button-images-and-callback-actions/45503/2 "2023-11-07T03:58:06Z")

</div>

> the images on each button/sprite don’t work

They’re all 404 in the console for that playground, so I’m not sure what you’re seeing that makes them semi-transparent. I updated your playground to use the ‘textures/player.png’ sprite provided by the playground server and it looks correct.

> is there a way to make the entire SPRITE an image? Like this playground? [https://www.babylonjs-playground.com/#XCPP9Y#3281](https://www.babylonjs-playground.com/#XCPP9Y#3281)

I’m not sure what you’re asking for here. Maybe you’re asking how to use the `BABYLON.GUI.Button.CreateImageButton` function with a sprite? This might help: [How to import Textures and Images from a sprite sheet? - #7 by earthendev](https://forum.babylonjs.com/t/how-to-import-textures-and-images-from-a-sprite-sheet/10129/7)

> Question 2) trying to pinpoint the BUTTON name or SPRITE name, so I can control the action in the onPointerDown callback. I’ve used the following format before to catch actions (see line #104 in playground above)
> 
> this usually works —\> (pickinfo.pickedMesh.name == “button6”) or (pickinfo.pick\> edMesh.name == “b6”)
> 
> but it’s not working in this example above. How can I access the sprite/button and catch the action in the onPointerDown callback? The material line seems to work fine in the example…

There is a different function for sprite picking. See:  
[Picking Sprites | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/features/featuresDeepDive/sprites/picking_sprites).

I updated your playground to show it:  
[my menu | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#7LHR3R#18).

Does that help?

---

_[View the full topic](https://forum.babylonjs.com/t/sprites-button-images-and-callback-actions/45503)._
