Cocos2d-x Lua Sprite vs ImageView: Image Replacement, Atlases and Scale9
Original environment: Cocos Studio 3.10, quick-Cocos2d-x 3.7.8, Windows 11.
When a scene comes from Cocos Studio, first check whether the node is a Sprite or an ImageView. They use different APIs to replace their textures.

Similarities and differences
Both can display an image. Sprite is a rendering node, while ImageView derives from the UI Widget hierarchy and provides UI-oriented features such as widget events and scale-nine behavior. Choose according to whether the node participates in the UI system and which behaviors it needs.
Replace the image
For a Sprite:
For an ImageView loaded from a standalone file:
| |
Use a texture atlas
Load the atlas:
| |
Set a Sprite frame from the atlas:
Set an ImageView texture from the atlas:
| |
The second argument selects a plist-backed texture in the API version used by this project.