MCPcopy
hub / github.com/g3n/engine / SetImage

Method SetImage

texture/texture2D.go:160–169  ·  view source on GitHub ↗

SetImage sets a new image for this texture

(imgfile string)

Source from the content-addressed store, hash-verified

158
159// SetImage sets a new image for this texture
160func (t *Texture2D) SetImage(imgfile string) error {
161
162 // Decodes image file into RGBA8
163 rgba, err := DecodeImage(imgfile)
164 if err != nil {
165 return err
166 }
167 t.SetFromRGBA(rgba)
168 return nil
169}
170
171// SetFromRGBA sets the texture data from the specified image.RGBA object
172func (t *Texture2D) SetFromRGBA(rgba *image.RGBA) {

Callers

nothing calls this directly

Calls 2

SetFromRGBAMethod · 0.95
DecodeImageFunction · 0.85

Tested by

no test coverage detected