Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Janilabo

OffsetBox

Recommended Posts

[scar]procedure OffsetBox(var bx: TBox; xOffset, yOffset: Integer);

begin

bx := Box((bx.X1 + xOffset), (bx.Y1 + yOffset), (bx.X2 + xOffset), (bx.Y2 + yOffset));

end;

 

var

m_bx, o_bx: TBox;

 

begin

m_bx := Box(100, 100, 200, 200);

WriteLn('m_bx: ' + BoxToStr(m_bx));

o_bx := m_bx;

OffsetBox(o_bx, 10, 10);

WriteLn('m_bx: ' + BoxToStr(o_bx) + ' [x-offset: 10, y-offset: 10]');

o_bx := m_bx;

OffsetBox(o_bx, -10, -10);

WriteLn('m_bx: ' + BoxToStr(o_bx) + ' [x-offset: -10, y-offset: -10]');

o_bx := m_bx;

OffsetBox(o_bx, 10, 0);

WriteLn('m_bx: ' + BoxToStr(o_bx) + ' [x-offset: 10]');

o_bx := m_bx;

OffsetBox(o_bx, 0, 10);

WriteLn('m_bx: ' + BoxToStr(o_bx) + ' [y-offset: 10]');

end.[/scar]

Edited by Janilabo

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...