Class: Raylib::Material

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/raylib/core/structs/material.rb

Overview

Material, includes shader and maps

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(shader, maps, params) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/raylib/core/structs/material.rb', line 10

def self.create(shader, maps, params)
  new.tap do |instance|
    instance[:shader] = shader
    instance[:maps] = maps
    instance[:params] = params
  end
end

Instance Method Details

#mapsMaterialMap *

Material maps array (MAX_MATERIAL_MAPS)

Returns:



33
# File 'lib/raylib/core/structs/material.rb', line 33

def maps = self[:maps]

#maps=(new_maps) ⇒ Object

Sets Material maps array (MAX_MATERIAL_MAPS)



36
37
38
# File 'lib/raylib/core/structs/material.rb', line 36

def maps=(new_maps)
  self[:maps] = new_maps
end

#paramsfloat[4]

Material generic parameters (if required)

Returns:

  • (float[4])

    params



42
# File 'lib/raylib/core/structs/material.rb', line 42

def params = self[:params]

#params=(new_params) ⇒ Object

Sets Material generic parameters (if required)



45
46
47
# File 'lib/raylib/core/structs/material.rb', line 45

def params=(new_params)
  self[:params] = new_params
end

#shaderShader

Material shader

Returns:



24
# File 'lib/raylib/core/structs/material.rb', line 24

def shader = self[:shader]

#shader=(new_shader) ⇒ Object

Sets Material shader



27
28
29
# File 'lib/raylib/core/structs/material.rb', line 27

def shader=(new_shader)
  self[:shader] = new_shader
end

#to_sObject



18
19
20
# File 'lib/raylib/core/structs/material.rb', line 18

def to_s
  "Raylib::Material##{object_id} shader=#{shader} maps=#{maps} params=#{params}"
end