実行時に呼び出すレコードを作成したいTSprite
。
TSprite
は、私が作成しているレベルエディタで使用している画像と8つの選択ポイントです。
type
TSprite = record
Image: TImage;
Selection: TSelection;
SelectionPointTL: TSelectionPoint; // top-left
SelectionPointTM: TSelectionPoint; // top-middle
SelectionPointTR: TSelectionPoint; // top-right
SelectionPointML: TSelectionPoint; // middle-left
SelectionPointMR: TSelectionPoint; // middle-right
SelectionPointBL: TSelectionPoint; // bottom-left
SelectionPointBM: TSelectionPoint; // bottom-middle
SelectionPointBR: TSelectionPoint; // bottom-right
end;
今、私はそれを配列に保存したいと思います。
arrSprites: array[0..1000] of TSprite;
そして今、創造(私が苦労している部分)
これは私がこれまでに持っているものです:
arrSprites[i].Image.Position.X := frmMainUI.CurrentMouseX;
arrSprites[i].Image.Position.Y := frmMainUI.CurrentMouseY;
arrSprites[i].Image.Bitmap.LoadFromFile('1.png');
arrSprites[i].Image.Visible := True;
arrSprites[i].Image.WrapMode := TImageWrapMode.iwStretch;
したがって、このコードが行うことになっているのは、名前がfsbcanvasであるスクロールボックス内に選択範囲を含む画像を作成することです。
明確にするために、のインスタンスを作成するコードを求めていますTSprite
。
ありがとう