## 紋理組
:-: 
**紋理組管理器**可從 IDE 的[工具](https://gamemakerchina.github.io/GMS2_manual_en2ch/source/_build/1_overview/2_quick_start/menus/tools_menu.html)菜單中獲得。在這里,你可以添加、刪除和重命名**紋理組(Texture Groups)**。*GameMaker Studio 2*允許你將每個圖形資源(精靈、圖塊集和字體)分配給不同的紋理組,以嘗試優化硬件在游戲中任何給定時間執行的紋理交換次數。要使其工作,你需要從此窗口定義必要的紋理組,然后瀏覽每個相應的資源類型,并從下拉菜單中選擇你希望它所屬的組。
**重要!**紋理組**不**適用于產品的試用許可證。
默認情況下,游戲中的所有圖像都將添加到 “默認” 紋理組中,該組始終存在。但是,你可以單擊*新增*按鈕以創建新的紋理組,如果選擇組的名稱,則可以將其更改為適當的名稱。新創建的組的每個部分(精靈,拼貼和字體)都將顯示 “該組為空”,因此你需要瀏覽資源并添加它們。你可以使用底部的*添加資源*按鈕添加資源,也可以從資源編輯器中為圖像、圖塊集或字體選擇紋理組。除 “默認” 之外的紋理組也可以隨時刪除,這會將其內容移動到 “默認” 組(請注意,如果你錯誤地刪除了一組,則可以使用/+Z來撤消操作)。
一旦定義了紋理組并為其指定了精靈,你將看到它們列在主紋理組編輯器窗口的左側,單擊此列表中的任何精靈將在右側的圖像預覽窗口中顯示它們。在處理大型項目時,這尤其有用,你需要能夠查看哪些精靈已分配給哪個組。請注意,如果分配給該組的精靈具有多個子圖像(即:它們是動畫),則在預覽窗口中僅顯示第一個子圖像。你還可以右鍵單擊資源以打開一個小菜單,為你提供將其移動到另一個紋理組或打開該資產的編輯器的選項。
值得注意的是,即使資源在列表中顯示為獨立的,所有精靈、圖塊集和字體也將添加到相同的紋理頁(或頁面),而不是為每種資源類型獲取單獨的頁面。
## 組設置
組設置用于確定如何使用以下可用選項創建給定組的紋理頁面:
* **允許縮放**\- 取消標記此操作將強制*GameMaker Studio 2*在任何情況下都不縮放紋理組。這可能很有用,尤其是在處理通用應用程序時,因為它允許你在特定設備上運行應用程序時將特定資源(如字體)放入其自己的組中。例如,字體在視網膜顯示器上看起來很棒,但是當它們按比例縮小以在正常顯示器上繪制時,它們看起來很糟糕,因此你可以將它們分配給特殊的非縮放組 - 如果為 iPhone 6 開發,則可以希望對此進行檢查,因為應用程序將因為圖像紋理縮放導致的模糊而被拒絕。默認情況下,此標記為已啟用。
* **自動裁剪**\- 當你將圖像添加到*GameMaker Studio 2*時,如果它們周圍有任何 “空白區域”(即 100% 透明度),則在將其添加到紋理頁并標記 “自動裁剪” 時會自動裁剪。但是,例如,如果你將圖像用作基元或類似物的非重復紋理,則意味著紋理映射的 UV 坐標將無法正確表示。在這些情況下,你可以取消標記此選項,并且精靈將 “按原樣” 添加到紋理頁面,保留其邊緣可能具有的任何透明度。默認情況下,此標記為已啟用。
* **生成多級漸進紋理(mipmap)**\- 標記此選項(默認情況下處于關閉狀態)將告訴*GameMaker Studio 2*原始紋理頁將被縮放并在紋理文件中過濾為多個分辨率。這通常是關閉的,但是如果你使用視圖放大或縮小游戲房間的大部分區域,或者你正在編寫 3D 游戲,那么你可能想要啟用此功能,然后使用[多級漸進紋理函數](https://gamemakerchina.github.io/GMS2_manual_en2ch/source/_build/3_scripting/4_gml_reference/drawing/mipmapping/index.html)來調整游戲處理不同的多級漸進紋理級別。標記此復選框時,“邊框大小” 值將設置為 8(如果設置為最初小于 8)。這是因為,當使用多級漸進紋理時,紋理頁面上的圖像之間需要更大的邊框,否則它們會在更高的 mip(拉丁文 multum in parvo)級別開始散開(?)。默認值 8 將允許圖像在子圖像開始散開之前減少到其原始大小的八分之一,但你可以將其更改為滿足你需要的任何值。請注意,如果你使用精靈的**獨立的紋理頁**選項,則不需要在此處檢查每個紋理并將其標記為生成多級漸進紋理,而是可以轉到[常規游戲選項](https://gamemakerchina.github.io/GMS2_manual_en2ch/source/_build/2_interface/3_settings/game_options/index.html)并勾選**為單獨的紋理頁生成多級漸進紋理(mipmap)。
* **邊框大小** - 邊框大小將更改為紋理組生成的頁面上所有資源邊緣周圍的重疊(或 “像素倍增”)量,以便在縮放圖像時,它們之間沒有可見的間隙(或接縫)。默認值為 2 像素,但在極端情況下,你要放大或縮小視圖,則可能需要增加此值。請注意,[圖塊集編輯器](https://gamemakerchina.github.io/GMS2_manual_en2ch/source/_build/2_interface/1_editors/tilesets.html)有一個選項可以設置圖塊的輸出邊框,這與此處的邊框設置是分開的 - 基本上,為臨時紋理上的每個圖塊生成具有輸出邊框的圖塊,然后將其添加到圍繞外邊緣給出邊框的紋理頁。另請注意,啟用多級漸進紋理會自動將紋理頁的默認邊框大小設置為 8,以幫助防止在較高 mip 級別的紋理之間 “散開”,但這可以更改。
* **父紋理組**- 你可以在此處選擇任何現有組作為當前所選組的 “父” 組。 “子” 組將繼承對父紋理組所做的任何更改,主要用于處理跨平臺游戲時的資源管理。具有父級的紋理組本身仍然是紋理組,并且將生成與任何其他組相同的紋理頁,但是將它們指定為父級允許你為不同平臺排除大量數據。例如,你可以將一整套 Android 玩家精靈添加到 “玩家” 組,并將 Android 敵人精靈添加到 “敵人” 組,然后讓他們都使用 “android” 父組。如果你從 Windows 或其他平臺構建中排除 “android” 父組,則子組也將被排除。
除了這些設置之外,你還可以選擇將任何給定紋理組導出(或不導出)到任何給定平臺,只需從窗口的**將該組用于……**部分選中或取消選中相應的框即可。請注意,**(默認)紋理組始終會導出到*每個*平臺**,并且你無法勾選 / 取消勾選那其中任何一個(只有自定義紋理組允許這樣做)。
## 配置
紋理組也鏈接到[配置](https://gamemakerchina.github.io/GMS2_manual_en2ch/source/_build/2_interface/3_settings/configurations.html)設置。這意味著你可以為游戲的每個單獨配置定義紋理組,然后將精靈、圖塊集或字體資源分配設置為這些不同的組,當你更改為其他配置時,它將被 “記住”。你在 “紋理組” 窗口中選擇的任何導出選項都會發生相同的情況,因此你可以將紋理組設置為基于每個配置導出到特定平臺。
例如,一個用途就是你可以制作一個 iPad 配置,然后創建 2048 x 2048 像素紋理頁面(通過[游戲選項](https://gamemakerchina.github.io/GMS2_manual_en2ch/source/_build/2_interface/3_settings/game_options/index.html)進行設置)。然后,你將所有圖形資源分配給相應的紋理組,完成后,你將更改為其他配置(例如,對于 HTML5),并從 “紋理組” 窗口創建 512 x 512 像素的新紋理組,給這些新組分配資產。頁面底部還有一個按鈕,允許你將紋理組設置從一個配置復制到另一個配置。
- 介紹
- 新手須知
- 版本授權
- 安裝
- 更新
- 發布日志
- 所需SDK
- 賬號
- 首選項設置
- 拖拽編程
- 擴展編輯器設置
- 基本項設置
- 圖片編輯器設置
- 語言設置
- 市場設置
- 對象編輯器設置
- 插件設置
- 資源樹設置
- 場景編輯器設置
- 運行庫設置
- 樣條編輯器設置
- 精靈編輯器設置
- 文本編輯器設置
- 瓷片編輯器設置
- 時間軸設置
- 輸入
- 快速上手
- 概覽
- 啟動頁
- 工作區
- 資源樹
- 工作流
- 創建精靈
- 創建瓷片集
- 創建音頻
- 創建對象
- 創建場景
- 編譯
- 調試
- 快捷鍵
- 菜單
- 文件菜單
- 編輯菜單
- 構建菜單
- 窗口菜單
- 工具菜單
- 市場菜單
- 幫助菜單
- 布局菜單
- 附加信息
- 位運算符和二進制
- 命令行
- 出錯信息
- 文件系統
- 導入非位圖精靈
- JSDoc使用
- 微型WEB服務端
- 過時函數
- 紋理頁
- 使用緩沖區
- 編輯器
- 擴展編輯器
- 字體編輯器
- 圖像編輯器
- 內含文件編輯器
- 備注編輯器
- 對象編輯器
- 路徑編輯器
- 場景編輯器
- 腳本編輯器
- 著色器編輯器
- 音頻編輯器
- 精靈編輯器
- 瓷片集編輯器
- 時間軸編輯器
- 對象可用事件
- 異步事件
- 繪制事件
- 手勢事件
- 其它
- 調試管理器
- 設備管理器
- YoYo資源市場
- 輸出停靠欄
- 項目圖生成器
- 最近使用窗口
- 遠程工作
- 混音器
- 版本控制
- 設置項
- 音頻組
- 配置項
- 跨平臺配置
- 紋理組
- 游戲配置選項
- AmazonFire 配置
- Android配置
- HTML5配置
- iOS配置
- Linux配置
- Mac配置
- Windows配置
- WindowsUWP配置
- 腳本編程
- 拖放編程概覽
- 拖放編程功能索引
- GML概覽
- 代碼
- 數組
- array_create
- array_copy
- array_equals
- array_length_1d
- array_height_2d
- array_length_2d
- 賦值
- 表達式
- 數據存取
- 功能性語法
- 函數
- 腳本
- 注釋
- 關鍵詞
- 變量及作用域
- variable_global_exists
- variable_global_get
- variable_global_set
- variable_instance_exists
- variable_instance_get
- variable_instance_get_names
- variable_instance_set
- 尋址變量
- 評估順序
- 數據類型
- is_array
- is_bool
- is_int32
- is_int64
- is_matrix
- is_ptr
- is_real
- is_string
- is_undefined
- is_vec3
- is_vec4
- 變元計數
- 指針
- 內置變量屬性
- async_load
- health
- lives
- score
- GML函數索引
- asset_get_index
- asset_get_type
- Compatibility_Functions
- Asynchronous Functions
- Audio
- Buffers
- Cameras And Display (攝像機和顯示)
- Cameras(攝像機)
- camera_apply
- camera_create
- camera_create_view
- camera_destroy
- camera_get_active
- camera_get_begin_script
- camera_get_default
- camera_get_end_script
- camera_get_proj_mat
- camera_get_update_script
- camera_get_view_angle
- camera_get_view_border_x
- camera_get_view_border_y
- camera_get_view_height
- camera_get_view_mat
- camera_get_view_speed_x
- camera_get_view_speed_y
- camera_get_view_target
- camera_get_view_width
- camera_get_view_x
- camera_get_view_y
- camera_set_begin_script
- camera_set_default
- camera_set_end_script
- camera_set_proj_mat
- camera_set_update_script
- camera_set_view_angle
- camera_set_view_border
- camera_set_view_mat
- camera_set_view_pos
- camera_set_view_size
- camera_set_view_speed
- camera_set_view_target
- view_camera
- view_current
- view_enabled
- view_get_camera
- view_get_hport
- view_get_surface_id
- view_get_visible
- view_get_wport
- view_get_xport
- view_get_yport
- view_hport
- view_set_camera
- view_set_hport
- view_set_surface_id
- view_set_visible
- view_set_wport
- view_set_xport
- view_set_yport
- view_surface_id
- view_visible
- view_wport
- view_xport
- view_yport
- The Screen Display
- Controls
- Data_Structures(數據結構)
- ds_exists
- ds_set_precision
- DS Grids
- DS Lists(列表)
- ds_list_create
- ds_list_destroy
- ds_list_clear
- ds_list_empty
- ds_list_size
- ds_list_add
- ds_list_set
- ds_list_delete
- ds_list_find_index
- ds_list_find_value
- ds_list_insert
- ds_list_replace
- ds_list_shuffle
- ds_list_sort
- ds_list_copy
- ds_list_read
- ds_list_write
- ds_list_mark_as_list
- ds_list_mark_as_map
- DS Maps(映射表)
- ds_map_exists
- ds_map_create
- ds_map_add
- ds_map_clear
- ds_map_copy
- ds_map_replace
- ds_map_delete
- ds_map_empty
- ds_map_size
- ds_map_find_first
- ds_map_find_last
- ds_map_find_next
- ds_map_find_previous
- ds_map_find_value
- ds_map_read
- ds_map_write
- ds_map_destroy
- ds_map_secure_save
- ds_map_secure_save_buffer
- ds_map_secure_load
- ds_map_secure_load_buffer
- ds_map_add_list
- ds_map_add_map
- ds_map_replace_list
- ds_map_replace_map
- DS Priority Queues
- DS Queues
- DS Stacks
- Debugging
- Drawing
- draw_enable_drawevent
- draw_flush
- Colour(顏色)
- colour_get_blue
- colour_get_green
- colour_get_hue
- colour_get_red
- colour_get_saturation
- colour_get_value
- draw_clear
- draw_clear_alpha
- draw_get_alpha
- draw_get_colour
- draw_getpixel
- draw_getpixel_ext
- draw_set_alpha
- draw_set_colour
- make_colour_hsv
- make_colour_rgb
- merge_colour
- Forms
- draw_arrow
- draw_button
- draw_circle
- draw_circle_colour
- draw_ellipse
- draw_ellipse_colour
- draw_healthbar
- draw_line
- draw_line_colour
- draw_line_width
- draw_line_width_colour
- draw_path
- draw_point
- draw_point_colour
- draw_rectangle
- draw_rectangle_colour
- draw_roundrect
- draw_roundrect_colour
- draw_roundrect_colour_ext
- draw_roundrect_ext
- draw_set_circle_precision
- draw_triangle
- draw_triangle_colour
- GPU
- gpu_get_alphatestenable
- gpu_get_alphatestref
- gpu_get_blendenable
- gpu_get_blendmode
- gpu_get_blendmode_dest
- gpu_get_blendmode_destalpha
- gpu_get_blendmode_ext
- gpu_get_blendmode_ext_sepalpha
- gpu_get_blendmode_src
- gpu_get_blendmode_srcalpha
- gpu_get_colorwriteenable
- gpu_get_cullmode
- gpu_get_fog
- gpu_get_state
- gpu_get_texfilter
- gpu_get_texfilter_ext
- gpu_get_texrepeat
- gpu_get_texrepeat_ext
- gpu_get_zfunc
- gpu_get_ztestenable
- gpu_get_zwriteenable
- gpu_pop_state
- gpu_push_state
- gpu_set_alphatestenable
- gpu_set_alphatestref
- gpu_set_blendenable
- gpu_set_blendmode
- gpu_set_blendmode_ext
- gpu_set_blendmode_ext_sepalpha
- gpu_set_colorwriteenable
- gpu_set_cullmode
- gpu_set_fog
- gpu_set_state
- gpu_set_texfilter
- gpu_set_texfilter_ext
- gpu_set_texrepeat
- gpu_set_texrepeat_ext
- gpu_set_zfunc
- gpu_set_ztestenable
- gpu_set_zwriteenable
- Lighting
- draw_get_lighting
- draw_light_define_ambient
- draw_light_define_direction
- draw_light_define_point
- draw_light_enable
- draw_light_get
- draw_light_get_ambient
- draw_set_lighting
- Mipmapping
- gpu_get_tex_max_aniso
- gpu_get_tex_max_aniso_ext
- gpu_get_tex_max_mip
- gpu_get_tex_max_mip_ext
- gpu_get_tex_min_mip
- gpu_get_tex_min_mip_ext
- gpu_get_tex_mip_bias
- gpu_get_tex_mip_bias_ext
- gpu_get_tex_mip_enable
- gpu_get_tex_mip_enable_ext
- gpu_get_tex_mip_filter
- gpu_get_tex_mip_filter_ext
- gpu_set_tex_max_aniso
- gpu_set_tex_max_aniso_ext
- gpu_set_tex_max_mip
- gpu_set_tex_max_mip_ext
- gpu_set_tex_min_mip
- gpu_set_tex_min_mip_ext
- gpu_set_tex_mip_bias
- gpu_set_tex_mip_bias_ext
- gpu_set_tex_mip_enable
- gpu_set_tex_mip_enable_ext
- gpu_set_tex_mip_filter
- gpu_set_tex_mip_filter_ext
- Particles
- Particle Emitters
- part_emitter_burst
- part_emitter_clear
- part_emitter_create
- part_emitter_destroy
- part_emitter_destroy_all
- part_emitter_exists
- part_emitter_region
- part_emitter_stream
- Particle Systems
- part_particles_clear
- part_particles_count
- part_particles_create
- part_particles_create_colour
- part_system_automatic_draw
- part_system_automatic_update
- part_system_clear
- part_system_create
- part_system_create_layer
- part_system_depth
- part_system_destroy
- part_system_draw_order
- part_system_drawit
- part_system_exists
- part_system_get_layer
- part_system_layer
- part_system_position
- part_system_update
- Particle Types
- part_type_alpha1
- part_type_alpha2
- part_type_alpha3
- part_type_blend
- part_type_clear
- part_type_colour_hsv
- part_type_colour_mix
- part_type_colour_rgb
- part_type_colour1
- part_type_colour2
- part_type_colour3
- part_type_create
- part_type_death
- part_type_destroy
- part_type_direction
- part_type_exists
- part_type_gravity
- part_type_life
- part_type_orientation
- part_type_scale
- part_type_shape
- part_type_size
- part_type_speed
- part_type_sprite
- part_type_step
- Simple Effects
- ef_cloud
- ef_ellipse
- ef_explosion
- ef_firework
- ef_flare
- ef_rain
- ef_ring
- ef_smoke
- ef_smokeup
- ef_snow
- ef_spark
- ef_star
- effect_clear
- effect_create_above
- effect_create_below
- Primitives(基本幾何體)
- draw_primitve_begin
- draw_primitive_begin_texture
- draw_primitive_end
- draw_vertex
- draw_vertex_colour
- draw_vertex_texture
- draw_vertex_texture_colour
- Primitive Building
- vertex_argb
- vertex_begin
- vertex_colour
- vertex_create_buffer
- vertex_create_buffer_ext
- vertex_create_buffer_from_buffer
- vertex_create_buffer_from_buffer_ext
- vertex_delete_buffer
- vertex_end
- vertex_float1
- vertex_float2
- vertex_float3
- vertex_float4
- vertex_freeze
- vertex_get_buffer_size
- vertex_get_number
- vertex_normal
- vertex_position
- vertex_position_3d
- vertex_submit
- vertex_texcoord
- vertex_ubyte4
- Vertex Formats
- vertex_format_add_colour
- vertex_format_add_custom
- vertex_format_add_normal
- vertex_format_add_position
- vertex_format_add_position_3d
- vertex_format_add_textcoord
- vertex_format_begin
- vertex_format_delete
- vertex_format_end
- Sprites_and_Tiles
- draw_enable_swf_aa
- draw_get_swf_aa_level
- draw_self
- draw_set_swf_aa_level
- draw_skeleton
- draw_skeleton_collision
- draw_skeleton_instance
- draw_skeleton_time
- draw_sprite
- draw_sprite_ext
- draw_sprite_general
- draw_sprite_part
- draw_sprite_part_ext
- draw_sprite_pos
- draw_sprite_stretched
- draw_sprite_stretched_ext
- draw_sprite_tiled
- draw_sprite_tiled_ext
- draw_tile
- draw_tilemap
- Surfaces
- application_get_position
- application_surface
- application_surface_draw_enable
- application_surface_enable
- application_surface_is_enabled
- draw_surface
- draw_surface_ext
- draw_surface_general
- draw_surface_part
- draw_surface_part_ext
- draw_surface_stretched
- draw_surface_stretched_ext
- draw_surface_tiled
- draw_surface_tiled_ext
- surface_copy
- surface_copy_part
- surface_create
- surface_create_ext
- surface_exists
- surface_free
- surface_get_height
- surface_get_texture
- surface_get_width
- surface_getpixel
- surface_getpixel_ext
- surface_reset_target
- surface_resize
- surface_save
- surface_save_part
- surface_set_target
- surface_set_target_ext
- The Application Surface
- Text
- draw_highscore
- draw_set_font
- draw_set_halign
- draw_set_valign
- draw_text
- draw_text_colour
- draw_text_ext
- draw_text_ext_colour
- draw_text_ext_transformed
- draw_text_ext_transformed_colour
- draw_text_transformed
- draw_text_transformed_colour
- Textures
- draw_texture_flush
- texture_get_height
- texture_get_texel_height
- texture_get_texel_width
- texture_get_uvs
- texture_get_width
- texture_global_scale
- texture_set_stage
- File Handing
- Fonts
- Game
- In App Purchases
- Instances
- 數學運算(Maths)
- Date and Time
- 數字方法(Number Functions)
- Vector Functions
- Matrices
- Miscellaneous
- Movement and Collisions
- Networking
- Objects
- Paths
- Physics
- 場景(Rooms)
- 常規的場景函數及變量(General Room Functions And Varibales)
- 常規圖層函數(General Layer Functions)
- 瓷片函數(TIlemap Tile Functions)
- 背景圖層(Backgrounds)
- 精靈圖層(Sprites)
- Scirpts
- Shaders
- Sprites
- Steam API
- Strings
- Timelines
- Web
- XBox_Live
- 翻譯名詞對照表