Skip to content

AutoMidHandle

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions

Blitz3DBlitzPlusBlitzBasic

AutoMidHandle

AutoMidHandle:Void enable:Int32
Parameter Mode Type Default Description
enable In Int32 required True to center the handle of new images, False to put it in the top left corner (the default).

Description

Turns on or off the automatic centering of the handle of every image that is loaded, created or copied from now on. The handle is the point of an image that sits at the position given to DrawImage. It starts in the top left corner. With AutoMidHandle on, it is in the middle of the image, which is what rotating and scaling sprites usually need. Images that already exist keep their handle.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
AutoMidHandle True
Local a = CreateImage(64, 64)
SetBuffer ImageBuffer(a)
Color 255, 160, 0
Oval 0, 0, 64, 64, 1
SetBuffer BackBuffer()
AutoMidHandle False
Local b = CreateImage(64, 64)
SetBuffer ImageBuffer(b)
Color 0, 160, 255
Oval 0, 0, 64, 64, 1
SetBuffer BackBuffer()
Cls
Color 255, 255, 255
Line 160, 0, 160, 239
Line 0, 120, 319, 120
DrawImage a, 80, 120
DrawImage b, 240, 120
Text 80, 200, "centered", 1, 1
Text 240, 200, "corner", 1, 1
Flip
WaitKey

Media

AutoMidHandle

Related Commands

HandleImage, ImageXHandle, ImageYHandle, MidHandle

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally