Class: Sketchup::Texture
| Relationships | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Entity
|
|
|
Instance Chain:
self,
Entity
|
|
| Inherits: |
Sketchup::Entity
|
Overview
The Texture class contains methods for obtaining information about textures that are part of your materials in your model (within the In-Model section of the Materials Browser). Remember, textures are repeatable images that “tile” when painted on a surface.
Instance Attribute Summary
-
#size=(size) ⇒ Integer, Array(Integer, Integer)
writeonly
The size= method allows you to set the size of the repeatable texture image, in inches,.
-
#valid? ⇒ Boolean
readonly
The valid? method ensures that a texture is valid.
Entity - Inherited
Instance Method Summary
-
#average_color ⇒ Sketchup::Color?
The average_color method retrieves a color object with the average color found in the texture.
-
#filename ⇒ String
The #filename method retrieves the entire path, including the file, for a texture object.
-
#height ⇒ Integer
The height method is used to get the height of a repeatable texture image, in inches.
-
#image_height ⇒ Integer
The image_height method retrieves the height of the repeatable texture image, in pixels.
-
#image_rep(colorized = false) ⇒ Sketchup::ImageRep
The #image_rep method returns a copy of a
ImageRepobject representing the texture pixel data. -
#image_width ⇒ Integer
The image_width method retrieves the width of the repeatable texture image, in pixels.
-
#width ⇒ Integer
The width method is used to get the width of a repeatable texture image, in inches.
-
#write(path, colorize = false) ⇒ Boolean
Writes the texture to file with option to preserve the color adjustments made by the material.
Entity - Inherited
| #add_observer | The add_observer method is used to add an observer to the current object. |
| #attribute_dictionaries | The attribute_dictionaries method is used to retrieve the |
| #attribute_dictionary | The attribute_dictionary method is used to retrieve an attribute dictionary with a given name that is attached to an |
| #delete_attribute | The |
| #entityID | The entityID method is used to retrieve a unique ID assigned to an entity. |
| #get_attribute | The |
| #inspect | The |
| #model | The model method is used to retrieve the model for the entity. |
| #parent | The parent method is used to retrieve the parent of the entity. |
| #persistent_id | The |
| #remove_observer | The remove_observer method is used to remove an observer from the current object. |
| #set_attribute | The set attribute is used to set the value of an attribute in an attribute dictionary with the given name. |
| #to_s | The |
| #typename | The typename method retrieves the type of the entity, which will be a string such as “Face”, “Edge”, or “Group”. |
Instance Attribute Details
#size=(size) ⇒ Integer, Array(Integer, Integer) (writeonly)
The size= method allows you to set the size of the repeatable texture image, in inches,
#valid? ⇒ Boolean (readonly)
The valid? method ensures that a texture is valid.
Instance Method Details
#average_color ⇒ Sketchup::Color?
The average_color method retrieves a color object with the average color found in the texture.
#filename ⇒ String
Since SketchUp 2021.0 this method will append a file extension matching the image format if the file extension is missing from stored filepath.
The #filename method retrieves the entire path, including the file, for a texture object.
#height ⇒ Integer
The height method is used to get the height of a repeatable texture image, in inches.
#image_height ⇒ Integer
The image_height method retrieves the height of the repeatable texture image, in pixels.
#image_rep(colorized = false) ⇒ Sketchup::ImageRep
The #image_rep method returns a copy of a ImageRep object representing the texture pixel data.
#image_width ⇒ Integer
The image_width method retrieves the width of the repeatable texture image, in pixels.
#width ⇒ Integer
The width method is used to get the width of a repeatable texture image, in inches.
#write(path, colorize = false) ⇒ Boolean
Writes the texture to file with option to preserve the color adjustments made by the material.