Search the web
Sign In
New User? Sign Up
delphigames · Discussion of game programming in the Delphi development environment.
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 7553 - 7582 of 7611   Newest  |  < Newer  |  Older >  |  Oldest
Messages: Show Message Summaries   (Group by Topic) Sort by Date v  
#7582 From: rbaprog <rbaprog@...>
Date: Thu Dec 13, 2007 1:21 pm
Subject: Re: [DelphiGames] How to make real transparency (with control)?
rbaprog
Offline Offline
Send Email Send Email
 
Ani_Silvia <ani_silvia@...> wrote:                               Hi guys,

  I'm trying to do control with real transparency – when you put a
  picture under it you must see the picture trough transparent pixels.
  Can you give me some guidance how to do it keeping in mind:
  1. I prefer to be derived from TGraphicControl.
  2. It must be flicker-free (even the most eye candy control makes
  me angry when it flicker).
  3. I will do per pixel semi-transparency (using 32bit icons,
  32bit png, 32bit GDI+).

  Or
  4. How to obtain part of the picture of a parent control that is under
  the control (what will have under the control if it was invisible).




You can get background using Themes unit and do various stuff, XP + only.
Avoid flicker is difficult with GraphicControl because Delphi does a lot of
forced redrawing but you can use DoubleBuffered property of Form and Panel, you
can also get image from Panel or Form since graphic controls are drawn on the
windowed parent as they do not have a window. You can make your own transparent
windowed control with transparency using regions but no alpha, maybe you can use
Alpha with the themes unit, Graphic controls are slower but they might be better
for some stuff while windowed controls are faster and you can achieve
transparency but i'm not sure if blending can be done, maybe using themes. Maybe
the best approach is to make your drawing on a large invisible bitmap and draw
that while calculating clicks on custom buttons, that way you have full control
and no flicker.


---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[Non-text portions of this message have been removed]

#7581 From: "Ian Munro" <ian.munro@...>
Date: Thu Dec 13, 2007 10:49 am
Subject: RE: [DelphiGames] Re: Help needed with sprite class design
ianathome12345
Offline Offline
Send Email Send Email
 
Hello,

     The Image class that my sprite class derives from is quite memory
efficient as it just holds a pointer to a SDL surface (I don't create
individual surfaces for each instance of the class). The Image class
only has a few properties that expose information about the Image such
as visibility, size and z-order. I created my sprite structure as two
classes for the following reasons:
1 ) I asked my self what is a sprite ? I decided that it was an image
that could be moved and sorted. With this in mind it seemed sensible to
separate the two functions, Image and Movement.
2) By keeping the Image details as a separate class I can easily change
the Graphics API by just deriving the the BaseSprite class from an Image
class that exposes the same properties. So I could use DelphiX, DirectX
or OpenGL etc without it effecting the sprite code.

I actually posted the same request on the PGD website and have made a
few changes based on their feedback. I have added some extra
functionality to the BaseSprite class. Some of the functions are just
virtual placeholders allowing me to override as required. This base
class is still quite abstract as I didn't want it to be "game specific"
as I want it to be reusable (its part of a game library I'm developing).

Thanks for your reply, I will look at the links your have sent as I'm
open to ideas.

Ian


It doesn't make sense to derive sprites from images since you may have
10 aliens attacking you and they could use the same image which would
save much memory. So TBaseSprite should descend from TObject and
contain TBaseImage. TBaseImage could implement methods that would make
animations easier. For example it could have a method
Draw(OnWhatSurface, FrameToDraw). Then TBaseSprite could have
FrameCount and CurrentFrame properties so that if sprite doesn't have
animations you can just set FrameCount to 1. You can take a look at
TSDLImage class in SDLDraw.pas from
http://sdlcontrols.sourceforge.net/files/sdlutils.zip
<http://sdlcontrols.sourceforge.net/files/sdlutils.zip>  to get an idea.

On Dec 12, 2007 1:13 PM, ai_no_kareshi <ai_no_kareshi@...
<mailto:ai_no_kareshi%40yahoo.com> > wrote:
>
> I don't know if this would be practical for you, but wouldn't it help
> if you treated non-animated sprites as an animated sprites that have
> only one frame of animation?
>
> Either way, I personally wouldn't derive a separate class for an
> animated sprite. My approach would be to incorporate it in the base
> sprite class. I might declare a function there that returns whether
> the sprite is to be animated or not, and in the derived classes
> override this to return whichever value is applicable.
>
> Hope this helped.
>
>
>
> --- In delphigames@yahoogroups.com
<mailto:delphigames%40yahoogroups.com> , "Ian" <ian.munro@...> wrote:
> >
> >
> > I have a design question and am interested in your views. In my game
I
> > use images as tiles to display the background and all the bits that
move
> > around and attack you. I have created a base class call TBaseImage
which
> > just contains a few properties such as the SDL surface, the size of
the
> > image and if its visible. I then have a TBaseSprite class that
derives
> > from TBaseImage which adds a few properties and methods such as a
> > virtual Update method and methods to kill and Resurrect it. I then
come
> > to the various game specific sprites that derive from TBaseSprite.
For
> > example, I have an "Alien" sprite which overrides the update method
and
> > modifies its x,y position (NB: Update is called every frame on
> > visible/alive sprites). I then realised that some sprites that can
be
> > shot should provide the following functionality: GetScore, HitCount,
> > Rewards etc. I then created a class called "TDestructibleSprite"
which
> > derives from TBaseSprite. I could then derive my "Alien" sprite from
> > TDestructibleSprite and get the extra functionality. If I have a
tile
> > that can't be destroyed I just derive it from TBaseSprite. Then I
> > realised that some sprites need to be animated so I started to think
> > about creating a class called TAnimatedSprite which would contain
> > functionality so that each Update the image would change to show the
> > animation. But what if I wanted a sprite that was both animated and
> > destructible ? Delphi doesn't support multiple inheritance so some
of
> > this functionality is going to have to be added into one of the
existing
> > classes. My question is, should I look into using interfaces ? Can
> > anyone recommend which classes should contain which functionality.
> > Should I look into Subclassing / Composition ?
> >
> > Shown below is my current sprite class structure:
> >
> >
> > TBaseImage
> > |
> > TBaseSprite
> > | |
> > TDestructibleSprite TAnimatedSprite
> > | |
> > TAlienSprite TAlienSprite

.

<http://geo.yahoo.com/serv?s=97359714/grpId=406/grpspId=1705006764/msgId
=7580/stime=1197540838/nc1=4507179/nc2=3848642/nc3=4836040>


This email is intended solely for the person to whom it is addressed and may
contain confidential or legally privileged information. If you are not the
intended recipient, be advised that you have received this email in error and
that any use, dissemination, forwarding, printing or copying of this email is
strictly prohibited. Please notify the author by replying to this email and
destroying all copies of the email and attachments. Access to this email by
anyone else is unauthorised.

Email may be susceptible to data corruption, interception, unauthorised
amendment, viruses and delays or the consequences thereof. Any views or opinions
presented are solely those of the author and do not necessarily represent those
of Grosvenor Technology Ltd.

Grosvenor Technology Ltd. (incorp. Newmark Technology Ltd.) is a company
registered in England with company number 2412554.
The Grosvenor Technology Ltd. Registered Office address is Millars Three,
Southmill Road, Bishop's Stortford, Herts, CM23


[Non-text portions of this message have been removed]

#7580 From: "Igor Stojkovic" <stojkovic.igor@...>
Date: Thu Dec 13, 2007 10:13 am
Subject: Re: [DelphiGames] Re: Help needed with sprite class design
jimyiigor
Offline Offline
Send Email Send Email
 
It doesn't make sense to derive sprites from images since you may have
10 aliens attacking you and they could use the same image which would
save much memory. So TBaseSprite should descend from TObject and
contain TBaseImage. TBaseImage could implement methods that would make
animations easier. For example it could have a method
Draw(OnWhatSurface, FrameToDraw). Then TBaseSprite could have
FrameCount and CurrentFrame properties so that if sprite doesn't have
animations you can just set FrameCount to 1. You can take a look at
TSDLImage class in SDLDraw.pas from
http://sdlcontrols.sourceforge.net/files/sdlutils.zip to get an idea.

On Dec 12, 2007 1:13 PM, ai_no_kareshi <ai_no_kareshi@...> wrote:
>
> I don't know if this would be practical for you, but wouldn't it help
>  if you treated non-animated sprites as an animated sprites that have
>  only one frame of animation?
>
>  Either way, I personally wouldn't derive a separate class for an
>  animated sprite. My approach would be to incorporate it in the base
>  sprite class. I might declare a function there that returns whether
>  the sprite is to be animated or not, and in the derived classes
>  override this to return whichever value is applicable.
>
>  Hope this helped.
>
>
>
>  --- In delphigames@yahoogroups.com, "Ian" <ian.munro@...> wrote:
>  >
>  >
>  > I have a design question and am interested in your views. In my game I
>  > use images as tiles to display the background and all the bits that move
>  > around and attack you. I have created a base class call TBaseImage which
>  > just contains a few properties such as the SDL surface, the size of the
>  > image and if its visible. I then have a TBaseSprite class that derives
>  > from TBaseImage which adds a few properties and methods such as a
>  > virtual Update method and methods to kill and Resurrect it. I then come
>  > to the various game specific sprites that derive from TBaseSprite. For
>  > example, I have an "Alien" sprite which overrides the update method and
>  > modifies its x,y position (NB: Update is called every frame on
>  > visible/alive sprites). I then realised that some sprites that can be
>  > shot should provide the following functionality: GetScore, HitCount,
>  > Rewards etc. I then created a class called "TDestructibleSprite" which
>  > derives from TBaseSprite. I could then derive my "Alien" sprite from
>  > TDestructibleSprite and get the extra functionality. If I have a tile
>  > that can't be destroyed I just derive it from TBaseSprite. Then I
>  > realised that some sprites need to be animated so I started to think
>  > about creating a class called TAnimatedSprite which would contain
>  > functionality so that each Update the image would change to show the
>  > animation. But what if I wanted a sprite that was both animated and
>  > destructible ? Delphi doesn't support multiple inheritance so some of
>  > this functionality is going to have to be added into one of the existing
>  > classes. My question is, should I look into using interfaces ? Can
>  > anyone recommend which classes should contain which functionality.
>  > Should I look into Subclassing / Composition ?
>  >
>  > Shown below is my current sprite class structure:
>  >
>  >
>  > TBaseImage
>  > |
>  > TBaseSprite
>  > | |
>  > TDestructibleSprite TAnimatedSprite
>  > | |
>  > TAlienSprite TAlienSprite
>  >
>  >


--
Pozdrav,
Igor Stojkovic mailto: stojkovic.igor@...

#7579 From: "ai_no_kareshi" <ai_no_kareshi@...>
Date: Wed Dec 12, 2007 12:13 pm
Subject: Re: Help needed with sprite class design
ai_no_kareshi
Offline Offline
Send Email Send Email
 
I don't know if this would be practical for you, but wouldn't it help
if you treated non-animated sprites as an animated sprites that have
only one frame of animation?

Either way, I personally wouldn't derive a separate class for an
animated sprite. My approach would be to incorporate it in the base
sprite class. I might declare a function there that returns whether
the sprite is to be animated or not, and in the derived classes
override this to return whichever value is applicable.

Hope this helped.



--- In delphigames@yahoogroups.com, "Ian" <ian.munro@...> wrote:
>
>
> I have a design question and am interested in your views. In my game I
> use images as tiles to display the background and all the bits that move
> around and attack you. I have created a base class call TBaseImage which
> just contains a few properties such as the SDL surface, the size of the
> image and if its visible. I then have a TBaseSprite class that derives
> from TBaseImage which adds a few properties and methods such as a
> virtual Update method and methods to kill and Resurrect it. I then come
> to the various game specific sprites that derive from TBaseSprite. For
> example, I have an "Alien" sprite which overrides the update method and
> modifies its x,y position (NB: Update is called every frame on
> visible/alive sprites). I then realised that some sprites that can be
> shot should provide the following functionality: GetScore, HitCount,
> Rewards etc. I then created a class called "TDestructibleSprite" which
> derives from TBaseSprite. I could then derive my "Alien" sprite from
> TDestructibleSprite and get the extra functionality. If I have a tile
> that can't be destroyed I just derive it from TBaseSprite. Then I
> realised that some sprites need to be animated so I started to think
> about creating a class called TAnimatedSprite which would contain
> functionality so that each Update the image would change to show the
> animation. But what if I wanted a sprite that was both animated and
> destructible ? Delphi doesn't support multiple inheritance so some of
> this functionality is going to have to be added into one of the existing
> classes. My question is, should I look into using interfaces ? Can
> anyone recommend which classes should contain which functionality.
> Should I look into Subclassing / Composition ?
>
> Shown below is my current sprite class structure:
>
>
>                      TBaseImage
>                              |
>                      TBaseSprite
>                          |       |
> TDestructibleSprite    TAnimatedSprite
>                 |                   |
> TAlienSprite               TAlienSprite
>
>
>
> [Non-text portions of this message have been removed]
>

#7578 From: "Ian" <ian.munro@...>
Date: Wed Dec 12, 2007 11:50 am
Subject: Help needed with sprite class design
ianathome12345
Offline Offline
Send Email Send Email
 
I have a design question and am interested in your views. In my game I
use images as tiles to display the background and all the bits that move
around and attack you. I have created a base class call TBaseImage which
just contains a few properties such as the SDL surface, the size of the
image and if its visible. I then have a TBaseSprite class that derives
from TBaseImage which adds a few properties and methods such as a
virtual Update method and methods to kill and Resurrect it. I then come
to the various game specific sprites that derive from TBaseSprite. For
example, I have an "Alien" sprite which overrides the update method and
modifies its x,y position (NB: Update is called every frame on
visible/alive sprites). I then realised that some sprites that can be
shot should provide the following functionality: GetScore, HitCount,
Rewards etc. I then created a class called "TDestructibleSprite" which
derives from TBaseSprite. I could then derive my "Alien" sprite from
TDestructibleSprite and get the extra functionality. If I have a tile
that can't be destroyed I just derive it from TBaseSprite. Then I
realised that some sprites need to be animated so I started to think
about creating a class called TAnimatedSprite which would contain
functionality so that each Update the image would change to show the
animation. But what if I wanted a sprite that was both animated and
destructible ? Delphi doesn't support multiple inheritance so some of
this functionality is going to have to be added into one of the existing
classes. My question is, should I look into using interfaces ? Can
anyone recommend which classes should contain which functionality.
Should I look into Subclassing / Composition ?

Shown below is my current sprite class structure:


                      TBaseImage
                              |
                      TBaseSprite
                          |       |
TDestructibleSprite    TAnimatedSprite
                 |                   |
TAlienSprite               TAlienSprite



[Non-text portions of this message have been removed]

#7577 From: "Ani_Silvia" <ani_silvia@...>
Date: Wed Dec 12, 2007 8:13 am
Subject: How to make real transparency (with control)?
ani_silvia
Offline Offline
Send Email Send Email
 
Hi guys,

I'm trying to do control with real transparency – when you put a
picture under it you must see the picture trough transparent pixels.
Can you give me some guidance how to do it keeping in mind:
1. I prefer to be derived from TGraphicControl.
2. It must be flicker-free (even the most eye candy control makes
me angry when it flicker).
3. I will do per pixel semi-transparency (using 32bit icons,
32bit png, 32bit GDI+).

Or
4. How to obtain part of the picture of a parent control that is under
the control (what will have under the control if it was invisible).

#7576 From: Dominique Louis <Dominique@...>
Date: Fri Nov 30, 2007 11:11 am
Subject: Re: How to hook changes in component size
dominiqueats...
Offline Offline
Send Email Send Email
 
Ani_Silvia wrote:
> P.S. Does somebody know why WM_SIZE dosn't trigger. (I know this is
> not a win control but ... it is strange)

It's been a while since I wrote a component as well, but I think a
WM_SIZE message will only get fired for controls that have a Window Handle.

Dominique.

#7575 From: "Ani_Silvia" <ani_silvia@...>
Date: Thu Nov 29, 2007 5:37 pm
Subject: Re: How to hook changes in component size
ani_silvia
Offline Offline
Send Email Send Email
 
Wow guys, you are great!

First thing that came to my mind was what Ian suggested. But as Steve
said: "Events are for external use. The methods are for internal use."
and that is why I rejected it imedately (athough I would come to this
if nothing else works).

"AfjustSize" looks like a good place to start. I couldn't
find "DoResize" (Delphi 7 Profesional) but there is "DoCanResize"
which is good enough.

Thank you very much TO ALL!!!

P.S. Does somebody know why WM_SIZE dosn't trigger. (I know this is
not a win control but ... it is strange)

#7574 From: <win95progman@...>
Date: Thu Nov 29, 2007 1:16 am
Subject: Re: [DelphiGames] How to hook changes in component size
win95progman
Offline Offline
Send Email Send Email
 
For number 1, you can override the AdjustSize proc:
ex.    procedure AdjustSize; override;
For number 2, you can override the CMColorChanged
message:
ex.    procedure CMColorChanged(var Message:
TMessage); message CM_COLORCHANGED;

If you have the source, take a look at the TWinControl
component which does both of the above.

--- Ani_Silvia <ani_silvia@...> wrote:

>
> Hi guys,
>
>
>
> It is quite these 2-3 months in this group. That is
> way I hope my
> question will activate discussions.
>
>
>
> Here I have a component derived from
> TGraphicControl:
>
>
>
> TmyComponent = class(TGraphicControl)
>
> …
>
> End;
>
>
>
> I would like to make some calculations when the
> component size changes.
> That is why I added:
>
> procedure WMSize(var Message: TWMSize); message
> WM_SIZE;
>
>
>
> The surprise was that it never triggers this method.
> That is why I have
> 2 questions:
>
>     1. What code to write so I can intercept changes
> in the size of the
> component?
>     2. I want to change the way my control looks
> when I change Color (it
> is inherited). What code to write so I can intercept
> changes in Color?
>
>
>
> I hope that this is peace of cake for you, but so
> simple things make me
> crazy (instead of thinking of improving the look,
> performance,… I
> have to think for a such trivial things).
>
> Thanks in advance!
>
>
>
> [Non-text portions of this message have been
> removed]
>
>



      
________________________________________________________________________________\
____
Get easy, one-click access to your favorites.
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs

#7573 From: Steve Williams <stevewilliams@...>
Date: Wed Nov 28, 2007 8:32 pm
Subject: Re: [DelphiGames] Re: How to hook changes in component size
slygamer
Offline Offline
Send Email Send Email
 
It's been a long time since I have done any Delphi component coding, but
in these cases there is usually a virtual method that calls the event
handler.  In this case, look for a DoResize() method in TGraphicControl
or TControl.  Override this method, making sure you call the inherited
method.  This way you do not have to hook the event handler.  Events are
for external use.  The methods are for internal use.

--
Sly

Ian Munro wrote:
> The calculations can be done inside your object by setting the OnResize
> callback in the constructor of your object:
>
> Class declaration:
>
>    TmyComponent = class (TGraphicControl)
>       private
>          procedure MyCallBack (Sender: TObject) ;
>       public
>          constructor Create (AOwner: TComponent) ;
>    end ;
>
> Implementation:
>
> constructor TmyComponent.Create (AOwner: TComponent) ;
> begin
>    inherited Create (AOwner) ;
>
>    OnResize := MyCallBack ;
> end ;
>
> procedure TmyComponent.MyCallBack (Sender: TObject) ;
> begin
>    // Do Stuff
> end ;
>
> Ian
>
> ________________________________
>
> From: delphigames@yahoogroups.com [mailto:delphigames@yahoogroups.com]
> On Behalf Of Ani_Silvia
> Sent: 28 November 2007 15:38
> To: delphigames@yahoogroups.com
> Subject: [DelphiGames] Re: How to hook changes in component size
>
>
>
> Well, this will work if I want the calculations to be made outside
> the component.
> But my goal is that the component itself will make the calculations
> when the control is resized (I neeed this calculations to make some
> pre calks before painting, but not on every painting - to speed up
> the process)
>
> --- In delphigames@yahoogroups.com
> <mailto:delphigames%40yahoogroups.com> , "Ian Munro" <ian.munro@...>
> wrote:
>
>> Hello,
>>
>> I've not tried this but you may want to give it a go. As
>> TGraphicControl derives from TControl, why not make use of
>>
> TControl's
>
>> OnResize event ?
>>
>> First define a callback function:
>>
>> procedure MyCallBack (Sender: TObject) ;
>>
>> Then pass this into the OnResize event on your "TmyComponent"
>>
> object:
>
>> test := TmyComponent.Create (nil);
>> test.OnResize := MyCallBack ;
>>
>> Even if it doesn't work it may anoy someone enough to shoot me
>>
> down in
>
>> flames :o)
>>
>> Ian
>>
>
>



This message and its attachments may contain legally privileged or confidential
information. This message is intended for the use of the individual or entity to
which it is addressed. If you are not the addressee indicated in this message,
or the employee or agent responsible for delivering the message to the intended
recipient, you may not copy or deliver this message or its attachments to
anyone. Rather, you should permanently delete this message and its attachments
and kindly notify the sender by reply e-mail. Any content of this message and
its attachments, which does not relate to the official business of the sending
company must be taken not to have been sent or endorsed by the sending company
or any of its related entities. No warranty is made that the e-mail or
attachment(s) are free from computer virus or other defect.

#7572 From: "Ian Munro" <ian.munro@...>
Date: Wed Nov 28, 2007 4:04 pm
Subject: RE: [DelphiGames] Re: How to hook changes in component size
ianathome12345
Offline Offline
Send Email Send Email
 
The calculations can be done inside your object by setting the OnResize
callback in the constructor of your object:

Class declaration:

    TmyComponent = class (TGraphicControl)
       private
          procedure MyCallBack (Sender: TObject) ;
       public
          constructor Create (AOwner: TComponent) ;
    end ;

Implementation:

constructor TmyComponent.Create (AOwner: TComponent) ;
begin
    inherited Create (AOwner) ;

    OnResize := MyCallBack ;
end ;

procedure TmyComponent.MyCallBack (Sender: TObject) ;
begin
    // Do Stuff
end ;

Ian

________________________________

From: delphigames@yahoogroups.com [mailto:delphigames@yahoogroups.com]
On Behalf Of Ani_Silvia
Sent: 28 November 2007 15:38
To: delphigames@yahoogroups.com
Subject: [DelphiGames] Re: How to hook changes in component size



Well, this will work if I want the calculations to be made outside
the component.
But my goal is that the component itself will make the calculations
when the control is resized (I neeed this calculations to make some
pre calks before painting, but not on every painting - to speed up
the process)

--- In delphigames@yahoogroups.com
<mailto:delphigames%40yahoogroups.com> , "Ian Munro" <ian.munro@...>
wrote:
>
> Hello,
>
> I've not tried this but you may want to give it a go. As
> TGraphicControl derives from TControl, why not make use of
TControl's
> OnResize event ?
>
> First define a callback function:
>
> procedure MyCallBack (Sender: TObject) ;
>
> Then pass this into the OnResize event on your "TmyComponent"
object:
>
> test := TmyComponent.Create (nil);
> test.OnResize := MyCallBack ;
>
> Even if it doesn't work it may anoy someone enough to shoot me
down in
> flames :o)
>
> Ian

.

<http://geo.yahoo.com/serv?s=97359714/grpId=406/grpspId=1705006764/msgId
=7571/stime=1196264285/nc1=4507179/nc2=3848642/nc3=4776367>


This email is intended solely for the person to whom it is addressed and may
contain confidential or legally privileged information. If you are not the
intended recipient, be advised that you have received this email in error and
that any use, dissemination, forwarding, printing or copying of this email is
strictly prohibited. Please notify the author by replying to this email and
destroying all copies of the email and attachments. Access to this email by
anyone else is unauthorised.

Email may be susceptible to data corruption, interception, unauthorised
amendment, viruses and delays or the consequences thereof. Any views or opinions
presented are solely those of the author and do not necessarily represent those
of Grosvenor Technology Ltd.

Grosvenor Technology Ltd. (incorp. Newmark Technology Ltd.) is a company
registered in England with company number 2412554.
The Grosvenor Technology Ltd. Registered Office address is Millars Three,
Southmill Road, Bishop's Stortford, Herts, CM23


[Non-text portions of this message have been removed]

#7571 From: "Ani_Silvia" <ani_silvia@...>
Date: Wed Nov 28, 2007 3:38 pm
Subject: Re: How to hook changes in component size
ani_silvia
Offline Offline
Send Email Send Email
 
Well, this will work if I want the calculations to be made outside
the component.
But my goal is that the component itself will make the calculations
when the control is resized (I neeed this calculations to make some
pre calks before painting, but not on every painting - to speed up
the process)


--- In delphigames@yahoogroups.com, "Ian Munro" <ian.munro@...>
wrote:
>
> Hello,
>
>     I've not tried this but you may want to give it a go. As
> TGraphicControl derives from TControl, why not make use of
TControl's
> OnResize event ?
>
> First define a callback function:
>
> procedure MyCallBack (Sender: TObject) ;
>
> Then pass this into the OnResize event on your "TmyComponent"
object:
>
> test := TmyComponent.Create (nil);
> test.OnResize := MyCallBack ;
>
> Even if it doesn't work it may anoy someone enough to shoot me
down in
> flames :o)
>
> Ian
>
> ________________________________
>
> From: delphigames@yahoogroups.com
[mailto:delphigames@yahoogroups.com]
> On Behalf Of Ani_Silvia
> Sent: 28 November 2007 15:00
> To: delphigames@yahoogroups.com
> Subject: [DelphiGames] How to hook changes in component size
>
>
>
>
> Hi guys,
>
> It is quite these 2-3 months in this group. That is way I hope my
> question will activate discussions.
>
> Here I have a component derived from TGraphicControl:
>
> TmyComponent = class(TGraphicControl)
>
> ...
>
> End;
>
> I would like to make some calculations when the component size
changes.
> That is why I added:
>
> procedure WMSize(var Message: TWMSize); message WM_SIZE;
>
> The surprise was that it never triggers this method. That is why I
have
> 2 questions:
>
> 1. What code to write so I can intercept changes in the size of the
> component?
> 2. I want to change the way my control looks when I change Color
(it
> is inherited). What code to write so I can intercept changes in
Color?
>
> I hope that this is peace of cake for you, but so simple things
make me
> crazy (instead of thinking of improving the look, performance,... I
> have to think for a such trivial things).
>
> Thanks in advance!
>
> .
>
> <http://geo.yahoo.com/serv?
s=97359714/grpId=406/grpspId=1705006764/msgId
> =7569/stime=1196261994/nc1=4507179/nc2=4763761/nc3=4840957>
>
>
> This email is intended solely for the person to whom it is
addressed and may contain confidential or legally privileged
information. If you are not the intended recipient, be advised that
you have received this email in error and that any use,
dissemination, forwarding, printing or copying of this email is
strictly prohibited. Please notify the author by replying to this
email and destroying all copies of the email and attachments. Access
to this email by anyone else is unauthorised.
>
> Email may be susceptible to data corruption, interception,
unauthorised amendment, viruses and delays or the consequences
thereof. Any views or opinions presented are solely those of the
author and do not necessarily represent those of Grosvenor
Technology Ltd.
>
> Grosvenor Technology Ltd. (incorp. Newmark Technology Ltd.) is a
company registered in England with company number 2412554.
> The Grosvenor Technology Ltd. Registered Office address is Millars
Three, Southmill Road, Bishop's Stortford, Herts, CM23
>
>
> [Non-text portions of this message have been removed]
>

#7570 From: "Ian Munro" <ian.munro@...>
Date: Wed Nov 28, 2007 3:18 pm
Subject: RE: [DelphiGames] How to hook changes in component size
ianathome12345
Offline Offline
Send Email Send Email
 
Hello,

     I've not tried this but you may want to give it a go. As
TGraphicControl derives from TControl, why not make use of TControl's
OnResize event ?

First define a callback function:

procedure MyCallBack (Sender: TObject) ;

Then pass this into the OnResize event on your "TmyComponent" object:

test := TmyComponent.Create (nil);
test.OnResize := MyCallBack ;

Even if it doesn't work it may anoy someone enough to shoot me down in
flames :o)

Ian

________________________________

From: delphigames@yahoogroups.com [mailto:delphigames@yahoogroups.com]
On Behalf Of Ani_Silvia
Sent: 28 November 2007 15:00
To: delphigames@yahoogroups.com
Subject: [DelphiGames] How to hook changes in component size




Hi guys,

It is quite these 2-3 months in this group. That is way I hope my
question will activate discussions.

Here I have a component derived from TGraphicControl:

TmyComponent = class(TGraphicControl)

...

End;

I would like to make some calculations when the component size changes.
That is why I added:

procedure WMSize(var Message: TWMSize); message WM_SIZE;

The surprise was that it never triggers this method. That is why I have
2 questions:

1. What code to write so I can intercept changes in the size of the
component?
2. I want to change the way my control looks when I change Color (it
is inherited). What code to write so I can intercept changes in Color?

I hope that this is peace of cake for you, but so simple things make me
crazy (instead of thinking of improving the look, performance,... I
have to think for a such trivial things).

Thanks in advance!

.

<http://geo.yahoo.com/serv?s=97359714/grpId=406/grpspId=1705006764/msgId
=7569/stime=1196261994/nc1=4507179/nc2=4763761/nc3=4840957>


This email is intended solely for the person to whom it is addressed and may
contain confidential or legally privileged information. If you are not the
intended recipient, be advised that you have received this email in error and
that any use, dissemination, forwarding, printing or copying of this email is
strictly prohibited. Please notify the author by replying to this email and
destroying all copies of the email and attachments. Access to this email by
anyone else is unauthorised.

Email may be susceptible to data corruption, interception, unauthorised
amendment, viruses and delays or the consequences thereof. Any views or opinions
presented are solely those of the author and do not necessarily represent those
of Grosvenor Technology Ltd.

Grosvenor Technology Ltd. (incorp. Newmark Technology Ltd.) is a company
registered in England with company number 2412554.
The Grosvenor Technology Ltd. Registered Office address is Millars Three,
Southmill Road, Bishop's Stortford, Herts, CM23


[Non-text portions of this message have been removed]

#7569 From: "Ani_Silvia" <ani_silvia@...>
Date: Wed Nov 28, 2007 2:59 pm
Subject: How to hook changes in component size
ani_silvia
Offline Offline
Send Email Send Email
 
Hi guys,



It is quite these 2-3 months in this group. That is way I hope my
question will activate discussions.



Here I have a component derived from TGraphicControl:



TmyComponent = class(TGraphicControl)

…

End;



I would like to make some calculations when the component size changes.
That is why I added:

procedure WMSize(var Message: TWMSize); message WM_SIZE;



The surprise was that it never triggers this method. That is why I have
2 questions:

     1. What code to write so I can intercept changes in the size of the
component?
     2. I want to change the way my control looks when I change Color (it
is inherited). What code to write so I can intercept changes in Color?



I hope that this is peace of cake for you, but so simple things make me
crazy (instead of thinking of improving the look, performance,… I
have to think for a such trivial things).

Thanks in advance!



[Non-text portions of this message have been removed]

#7568 From: xiaorang@...
Date: Fri Nov 23, 2007 2:57 am
Subject: good idea
xiaorang2003...
Offline Offline
Send Email Send Email
 
This is mostly a test. But Stream is realy a good thing.
I'd like to introduce some of useful class I ever used.

1. DataObj
     TDataObj= class
         procedure SaveToStream(aStream: TStream); virtual; abstract;
         procedure LoadFromStream(aStream: TStream); virtual; abstract;
         procedure SaveToFile(aFileName: string); virtual;
         procedure LoadFromFile(aFileName: string); virtual;
     end;
{ TDataObj }

procedure TDataObj.LoadFromFile(aFileName: string);
var
    fStream: TFileStream;
begin
      if not FileExists(aFileName) then begin
         exit;
      end else begin
          fStream:= TFileSTream.Create(aFileName, fmOpenRead+ fmShareExclusive);
      end;
      try
         LoadFromStream(fStream);
      finally
         fStream.Free;
      end;
end;

procedure TDataObj.SaveToFile(aFileName: string);
var
    fStream: TFileStream;
begin
      fStream:= TFileSTream.Create(aFileName, fmCreate);
      try
         SaveToStream(fStream);
      finally
         fStream.Free;
      end;
end;

2.TCryptObj

     TCryptObj= class(TDataObj)
         procedure SaveToFile(aFileName, aPwd: string); overload;
         procedure LoadFromFile(aFileName, aPwd: string); overload;
   end;

{ TCryptObj }

procedure TCryptObj.LoadFromFile(aFileName, aPwd: string);
var
    fStream: TFileStream;
    mStream: TMemoryStream;
    d1: DWord;
begin
      if not FileExists(aFileName) then begin
         exit;
      end else begin
          fStream:= TFileSTream.Create(aFileName, fmOpenRead+ fmShareExclusive);
      end;
      mStream:= TMemoryStream.Create;
      try
         fStream.Position:= 0;
         mStream.CopyFrom(fStream, fStream.Size);
         d1:= mStream.Size;
         Decrypt(mStream.Memory, d1, aPwd);
         mStream.Position:= 0;
         LoadFromStream(mStream);
      finally
         fStream.Free;
         mStream.Free;
      end;
end;

procedure TCryptObj.SaveToFile(aFileName, aPwd: string);
var
    fStream: TFileStream;
    mStream: TMemoryStream;
    d1: DWord;
begin
      fStream:= TFileSTream.Create(aFileName, fmCreate);
      mStream:= TMemoryStream.Create;
      try
         SaveToStream(mStream);
         d1:= mStream.Size;
         Encrypt(mStream.Memory, d1, aPwd);
         mStream.Position:= 0;
         fStream.CopyFrom(mStream, mStream.Size);
      finally
         fStream.Free;
         mStream.Free;
      end;
end;






==========================
263µç×ÓÓʼþ£­ÐÅÀµÓÊ×Ôרҵ

#7567 From: "Ian Munro" <ian.munro@...>
Date: Tue Nov 20, 2007 8:19 am
Subject: RE: [DelphiGames] saving data with a header
ianathome12345
Offline Offline
Send Email Send Email
 
Thanks to all of you that gave advice. Streams certainly seem the way to
go.

Now I just have to design loads of graphics :o(

Ian.


win95progman@... <mailto:win95progman%40yahoo.com>  wrote:
Use TFileStream, it is faster and more efficient.
Example:

var
Stream : TFileStream;
I : Integer;
begin
// write
Stream := TFileStream.Create(MyFileName,
fmCreate);
Stream.Write(FileHeader, SizeOf(TFileHeader));
For I := 1 to FileHeader.SpriteCount do
Stream.Write(Sprite[i], SizeOf(TSprite));
Stream.Free;

// read
Stream := TFileStream.Create(MyFileName, fmRead);
Stream.Read(FileHeader, SizeOf(TFileHeader));
For I := 1 to FileHeader.SpriteCount do
Stream.Read(Sprite[i], SizeOf(TSprite));
Stream.Free;

end;
-----

Streams are great, very fast and compatible with other Stream types such
as TMemoryStream and are widely used in delphi for just about anything
that requires disk access, you can read/write custom data in a very
efficient way.

Razvan

.

<http://geo.yahoo.com/serv?s=97359714/grpId=406/grpspId=1705006764/msgId
=7566/stime=1195504809/nc1=4507179/nc2=5045821/nc3=4990221>


This email is intended solely for the person to whom it is addressed and may
contain confidential or legally privileged information. If you are not the
intended recipient, be advised that you have received this email in error and
that any use, dissemination, forwarding, printing or copying of this email is
strictly prohibited. Please notify the author by replying to this email and
destroying all copies of the email and attachments. Access to this email by
anyone else is unauthorised.

Email may be susceptible to data corruption, interception, unauthorised
amendment, viruses and delays or the consequences thereof. Any views or opinions
presented are solely those of the author and do not necessarily represent those
of Grosvenor Technology Ltd.

Grosvenor Technology Ltd. (incorp. Newmark Technology Ltd.) is a company
registered in England with company number 2412554.
The Grosvenor Technology Ltd. Registered Office address is Millars Three,
Southmill Road, Bishop's Stortford, Herts, CM23


[Non-text portions of this message have been removed]

#7566 From: rbaprog <rbaprog@...>
Date: Mon Nov 19, 2007 9:20 am
Subject: Re: [DelphiGames] saving data with a header
rbaprog
Offline Offline
Send Email Send Email
 
win95progman@...  wrote:
  Use TFileStream, it is faster and more efficient.
  Example:

  var
    Stream : TFileStream;
    I : Integer;
  begin
      // write
      Stream := TFileStream.Create(MyFileName,
  fmCreate);
      Stream.Write(FileHeader, SizeOf(TFileHeader));
      For I := 1 to FileHeader.SpriteCount do
          Stream.Write(Sprite[i], SizeOf(TSprite));
      Stream.Free;

  // read
      Stream := TFileStream.Create(MyFileName, fmRead);
      Stream.Read(FileHeader, SizeOf(TFileHeader));
      For I := 1 to FileHeader.SpriteCount do
          Stream.Read(Sprite[i], SizeOf(TSprite));
      Stream.Free;

  end;
-----

Streams are great, very fast and compatible with other Stream types such as
TMemoryStream and are widely used in delphi for just about anything that
requires disk access, you can read/write custom data in a very efficient way.

Razvan






---------------------------------
Never miss a thing.   Make Yahoo your homepage.

[Non-text portions of this message have been removed]

#7565 From: <win95progman@...>
Date: Fri Nov 16, 2007 7:07 pm
Subject: Re: [DelphiGames] saving data with a header
win95progman
Offline Offline
Send Email Send Email
 
Hi Ian,

Use TFileStream, it is faster and more efficient.
Example:

var
   Stream : TFileStream;
   I : Integer;
begin
     // write
     Stream := TFileStream.Create(MyFileName,
fmCreate);
     Stream.Write(FileHeader, SizeOf(TFileHeader));
     For I := 1 to FileHeader.SpriteCount do
         Stream.Write(Sprite[i], SizeOf(TSprite));
     Stream.Free;

     // read
     Stream := TFileStream.Create(MyFileName, fmRead);
     Stream.Read(FileHeader, SizeOf(TFileHeader));
     For I := 1 to FileHeader.SpriteCount do
         Stream.Read(Sprite[i], SizeOf(TSprite));
     Stream.Free;

end;

I hope this helps.

-Tom,

--- Ian Munro <ian.munro@...>
wrote:

> Hello,
>
> I've created a program that exports map data for use
> in my game. The
> information about each tile is held in a record and
> is saved to disk
> using the "File of" expression. Shown below is the
> record and the
> function that does this:
>
>    pSpritRec = ^TSpriteRec ;
>    TSpriteRec = record
>       SprType : integer ;
>       XPos    : integer ;
>       YPos    : integer ;
>       ImgRect : TRect ;
>    end ;
>
> procedure  TSpriteDataHandler.DoTheExportToFile
> (const FileName :
> string) ;
> var
>    ARecord : pSpritRec ;
>    F : file of TSpriteRec ;
>    iCnt : integer ;
>
> begin
>    AssignFile (F, FileName) ;
>    Rewrite (F) ;
>    try
>       iCnt := 0 ;
>       while iCnt < m_ExportList.Count do
>       begin
>          ARecord := m_ExportList.Items [iCnt] ;
>          Write (F, ARecord^) ;
>
>          inc (iCnt) ;
>       end ;
>    finally
>       CloseFile (F) ;
>    end ;
> end ;
>
> This works fine and my test app loads in the file
> and verifies the
> contents. What I want to do is to store the data for
> all the levels in
> one file. This would mean adding a header to the
> file that says how many
> levels there are and the length of each level. This
> would allow me to
> load the file and store the data accordingly. My
> question is, how would
> I go about adding a header ? Adding something that
> isn't a "TSpriteRec"
> at the front of the file won't be loaded using a
> "Read (F, ARecord^)".
> Should I add all the data to a buffer and save it a
> byte at a time. I
> could then load it in a byte at a time and extract
> the first "n bytes"
> as the header. Any other ideas ?
>
> Ian
>
>
> This email is intended solely for the person to whom
> it is addressed and may contain confidential or
> legally privileged information. If you are not the
> intended recipient, be advised that you have
> received this email in error and that any use,
> dissemination, forwarding, printing or copying of
> this email is strictly prohibited. Please notify the
> author by replying to this email and destroying all
> copies of the email and attachments. Access to this
> email by anyone else is unauthorised.
>
> Email may be susceptible to data corruption,
> interception, unauthorised amendment, viruses and
> delays or the consequences thereof. Any views or
> opinions presented are solely those of the author
> and do not necessarily represent those of Grosvenor
> Technology Ltd.
>
> Grosvenor Technology Ltd. (incorp. Newmark
> Technology Ltd.) is a company registered in England
> with company number 2412554.
> The Grosvenor Technology Ltd. Registered Office
> address is Millars Three, Southmill Road, Bishop's
> Stortford, Herts, CM23
>
>
> [Non-text portions of this message have been
> removed]
>
>



      
________________________________________________________________________________\
____
Be a better sports nut!  Let your teams follow you
with Yahoo Mobile. Try it now. 
http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ

#7564 From: "Ian Munro" <ian.munro@...>
Date: Fri Nov 16, 2007 5:15 pm
Subject: RE: [DelphiGames] saving data with a header
ianathome12345
Offline Offline
Send Email Send Email
 
Hello,

I think I've resolved my problem. I am now writing out the file using
"file of integer". I first write the header which has a fixed length,
this is followed by all the tile data. The info in the header tells me
how many tiles are used on each level so I read in the defined amount
and store each levels data separately. It seems to work ok so unless
someone can come up a cracking alterative I'll stick to loading in the
data one integer at a time.

Ian

Ian Wrote:


I've created a program that exports map data for use in my game. The
information about each tile is held in a record and is saved to disk
using the "File of" expression. Shown below is the record and the
function that does this:

pSpritRec = ^TSpriteRec ;
TSpriteRec = record
SprType : integer ;
XPos : integer ;
YPos : integer ;
ImgRect : TRect ;
end ;

procedure TSpriteDataHandler.DoTheExportToFile (const FileName :
string) ;
var
ARecord : pSpritRec ;
F : file of TSpriteRec ;
iCnt : integer ;

begin
AssignFile (F, FileName) ;
Rewrite (F) ;
try
iCnt := 0 ;
while iCnt < m_ExportList.Count do
begin
ARecord := m_ExportList.Items [iCnt] ;
Write (F, ARecord^) ;

inc (iCnt) ;
end ;
finally
CloseFile (F) ;
end ;
end ;

This works fine and my test app loads in the file and verifies the
contents. What I want to do is to store the data for all the levels in
one file. This would mean adding a header to the file that says how many
levels there are and the length of each level. This would allow me to
load the file and store the data accordingly. My question is, how would
I go about adding a header ? Adding something that isn't a "TSpriteRec"
at the front of the file won't be loaded using a "Read (F, ARecord^)".
Should I add all the data to a buffer and save it a byte at a time. I
could then load it in a byte at a time and extract the first "n bytes"
as the header. Any other ideas

.

<http://geo.yahoo.com/serv?s=97359714/grpId=406/grpspId=1705006764/msgId
=7563/stime=1195208054/nc1=4507179/nc2=4776367/nc3=4836042>


This email is intended solely for the person to whom it is addressed and may
contain confidential or legally privileged information. If you are not the
intended recipient, be advised that you have received this email in error and
that any use, dissemination, forwarding, printing or copying of this email is
strictly prohibited. Please notify the author by replying to this email and
destroying all copies of the email and attachments. Access to this email by
anyone else is unauthorised.

Email may be susceptible to data corruption, interception, unauthorised
amendment, viruses and delays or the consequences thereof. Any views or opinions
presented are solely those of the author and do not necessarily represent those
of Grosvenor Technology Ltd.

Grosvenor Technology Ltd. (incorp. Newmark Technology Ltd.) is a company
registered in England with company number 2412554.
The Grosvenor Technology Ltd. Registered Office address is Millars Three,
Southmill Road, Bishop's Stortford, Herts, CM23


[Non-text portions of this message have been removed]

#7563 From: "Ian Munro" <ian.munro@...>
Date: Fri Nov 16, 2007 10:14 am
Subject: saving data with a header
ianathome12345
Offline Offline
Send Email Send Email
 
Hello,

I've created a program that exports map data for use in my game. The
information about each tile is held in a record and is saved to disk
using the "File of" expression. Shown below is the record and the
function that does this:

    pSpritRec = ^TSpriteRec ;
    TSpriteRec = record
       SprType : integer ;
       XPos    : integer ;
       YPos    : integer ;
       ImgRect : TRect ;
    end ;

procedure  TSpriteDataHandler.DoTheExportToFile (const FileName :
string) ;
var
    ARecord : pSpritRec ;
    F : file of TSpriteRec ;
    iCnt : integer ;

begin
    AssignFile (F, FileName) ;
    Rewrite (F) ;
    try
       iCnt := 0 ;
       while iCnt < m_ExportList.Count do
       begin
          ARecord := m_ExportList.Items [iCnt] ;
          Write (F, ARecord^) ;

          inc (iCnt) ;
       end ;
    finally
       CloseFile (F) ;
    end ;
end ;

This works fine and my test app loads in the file and verifies the
contents. What I want to do is to store the data for all the levels in
one file. This would mean adding a header to the file that says how many
levels there are and the length of each level. This would allow me to
load the file and store the data accordingly. My question is, how would
I go about adding a header ? Adding something that isn't a "TSpriteRec"
at the front of the file won't be loaded using a "Read (F, ARecord^)".
Should I add all the data to a buffer and save it a byte at a time. I
could then load it in a byte at a time and extract the first "n bytes"
as the header. Any other ideas ?

Ian


This email is intended solely for the person to whom it is addressed and may
contain confidential or legally privileged information. If you are not the
intended recipient, be advised that you have received this email in error and
that any use, dissemination, forwarding, printing or copying of this email is
strictly prohibited. Please notify the author by replying to this email and
destroying all copies of the email and attachments. Access to this email by
anyone else is unauthorised.

Email may be susceptible to data corruption, interception, unauthorised
amendment, viruses and delays or the consequences thereof. Any views or opinions
presented are solely those of the author and do not necessarily represent those
of Grosvenor Technology Ltd.

Grosvenor Technology Ltd. (incorp. Newmark Technology Ltd.) is a company
registered in England with company number 2412554.
The Grosvenor Technology Ltd. Registered Office address is Millars Three,
Southmill Road, Bishop's Stortford, Herts, CM23


[Non-text portions of this message have been removed]

#7562 From: "Ani_Silvia" <ani_silvia@...>
Date: Tue Nov 13, 2007 10:14 am
Subject: Bug in Delphi ???
ani_silvia
Offline Offline
Send Email Send Email
 
Hi guys

I came to a very strange situation: Folowing th advice of Ian, I
declared:
type
   TmyGradient=record
     Numb   : integer;
     Colors : array of cardinal;
     Pos    : array of single;
   end;

Const
   BluPresetColors : array [0..2] of Cardinal = ($FF0000BB,
$FF00FF00, $FFFF0000);
   BluPresetPos : array[0..2] of single = (0,0.3,1);
   BluePreset:TmyGradient=(Numb:3; Colors:@BluPresetColors;
Pos:@BluPresetPos);

as far as good, everithing look normal. When I added the unit for
GDI+ (GDIPObj), every time I close the application, I receive 'Run
time error 216'.

What realy happen in GDIPObj, is that in finalization:
   if assigned(GenericTypographicStringFormatBuffer) then
GenericTypographicStringFormatBuffer.free;
GenericTypographicStringFormatBuffer is not nil (there is no code to
use or iniatilize this variable). Even more I intercepted OnDestroy
on the main form - the variable is nil.

The only code that uses GenericTypographicStringFormatBuffer is:
   class function TGPStringFormat.GenericTypographic: TGPStringFormat;
   begin
     if not assigned(GenericTypographicStringFormatBuffer) then
     begin
       GenericTypographicStringFormatBuffer := TGPStringFormat.Create;
       GenericTypographicStringFormatBuffer.lastError :=
         GdipStringFormatGetGenericTypographic
(GenericTypographicStringFormatBuffer.nativeFormat);
     end;
     result := GenericTypographicStringFormatBuffer;
   end;

What really made me angry is that if i put a commentar on
   BluePreset:TmyGradient=(Numb:3; Colors:@BluPresetColors;
Pos:@BluPresetPos);
everything works perfect. If I remove the // it gives the error.

So I have 2 questions:
1. Is there any special in class functions? Are they invoked
directly or indirectly (I never used them)
2. What is so special about:
Const
   BluPresetColors : array [0..2] of Cardinal = ($FF0000BB,
$FF00FF00, $FFFF0000);
   BluPresetPos : array[0..2] of single = (0,0.3,1);
   BluePreset:TmyGradient=(Numb:3; Colors:@BluPresetColors;
Pos:@BluPresetPos);
I suppose BluePreset is created in run time and somehow when it
tries to free it, it makes GenericTypographicStringFormatBuffer
invalid (address).

I hope people that makes games will know how Delphi really work :)

#7561 From: "Ian Munro" <ian.munro@...>
Date: Mon Nov 5, 2007 8:46 am
Subject: RE: [DelphiGames] SDL Controls
ianathome12345
Offline Offline
Send Email Send Email
 
Hi Igor,

     This group is very quiet these days which is a real shame. You
should try posting on the SDL section of this website
http://www.pascalgamedevelopment.com/ as its a lot more active.

     I'm currently writing a game that may use your controls. I'm still
busy writing code to scroll my background images so the gui side of
things are still a long way off.

     Good luck.

     Ian

________________________________

From: delphigames@yahoogroups.com [mailto:delphigames@yahoogroups.com]
On Behalf Of Igor Stojkovic
Sent: 03 November 2007 20:27
To: delphigames@yahoogroups.com
Subject: [DelphiGames] SDL Controls



Hello everybody! I wasn't very active here for some time but I managed
to
get almost to the end of Electrotehnic faculty and now I got a job so
again
I don't have mush free time. But I was thinking that maybe I could use
some
of that free time to return to developing my SDL Controls (
http://sdlcontrols.sourceforge.net <http://sdlcontrols.sourceforge.net>
).

I would like to make them very adaptable so that they could easily be
used
not just with SDL and OpenGL but with GLScene, DirectX, maybe even GDI.
I
have many other high goals (become concurrent with Qt and gtk but also
with
a possability of using in games:), but I would go one step at a time. I
am
not sure I could devote enough time to this so I am not sure I will
develop
them further, but before I decide I would like some response from you.

I would like to know if any of you guys use my controls, how many of
you, if
any of you is interested in using them and if any of you is interested
in
helping me develop them.

--
Greetings,
Igor Stojkovic mailto: stojkovic.igor@...
<mailto:stojkovic.igor%40gmail.com>

[Non-text portions of this message have been removed]





This email is intended solely for the person to whom it is addressed and may
contain confidential or legally privileged information. If you are not the
intended recipient, be advised that you have received this email in error and
that any use, dissemination, forwarding, printing or copying of this email is
strictly prohibited. Please notify the author by replying to this email and
destroying all copies of the email and attachments. Access to this email by
anyone else is unauthorised.

Email may be susceptible to data corruption, interception, unauthorised
amendment, viruses and delays or the consequences thereof. Any views or opinions
presented are solely those of the author and do not necessarily represent those
of Grosvenor Technology Ltd.

Grosvenor Technology Ltd. (incorp. Newmark Technology Ltd.) is a company
registered in England with company number 2412554.
The Grosvenor Technology Ltd. Registered Office address is Millars Three,
Southmill Road, Bishop's Stortford, Herts, CM23


[Non-text portions of this message have been removed]

#7560 From: "Igor Stojkovic" <stojkovic.igor@...>
Date: Sat Nov 3, 2007 8:26 pm
Subject: SDL Controls
jimyiigor
Offline Offline
Send Email Send Email
 
Hello everybody! I wasn't very active here for some time but I managed to
get almost to the end of Electrotehnic faculty and now I got a job so again
I don't have mush free time. But I was thinking that maybe I could use some
of that free time to return to developing my SDL Controls (
http://sdlcontrols.sourceforge.net).

I would like to make them very adaptable so that they could easily be used
not just with SDL and OpenGL but with GLScene, DirectX, maybe even GDI. I
have many other high goals (become concurrent with Qt and gtk but also with
a possability of using in games:), but I would go one step at a time. I am
not sure I could devote enough time to this so I am not sure I will develop
them further, but before I decide I would like some response from you.

I would like to know if any of you guys use my controls, how many of you, if
any of you is interested in using them and if any of you is interested in
helping me develop them.


--
Greetings,
Igor Stojkovic mailto: stojkovic.igor@...


[Non-text portions of this message have been removed]

#7559 From: <win95progman@...>
Date: Thu Nov 1, 2007 10:31 pm
Subject: Re: [DelphiGames] Dynamic Record
win95progman
Offline Offline
Send Email Send Email
 
Here are a couple of good GDI+ for delphi links:
http://lummie.co.uk/gdi-controls-for-delphi/ - several
good GDI+ controls FW
http://www.progdigy.com/modules.php?name=gdiplus -
GDI+ API


--- Ani_Silvia <ani_silvia@...> wrote:

> Hi,
>
> In a number of applications I needed a structure
> like this:
>
> type
> MyStructure = record
>   Num : integer;
>   Arr : array[0..n] of ...;
>   Str : array[0..n] of ...;
> end;
>
> Basicly it is a record, where a member shows the
> number of 2+ arrays
> (also members of the structure), but it must be
> dynamic (will be
> known in run time, can change over time depends on
> Numb member).
> Also I want Str memmber to come right after Num
> elements of Arr.
>
> So my question is - how to declare this in Delphi?
>
> One example that I hope most of you are familiar -
> bitmap file:
>   <header>
>   <palette>
>   <bitmap>
> size of <palette> depend of the information in
> <header>.
>
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#7558 From: "Ian Munro" <ian.munro@...>
Date: Thu Nov 1, 2007 10:02 am
Subject: RE: [DelphiGames] Dynamic Record
ianathome12345
Offline Offline
Send Email Send Email
 
Would this work for you ?

MyStructure = record
    Num : integer;
    Arr : array of integer ;
    Str : array of integer ;
end;

Ian


________________________________

From: delphigames@yahoogroups.com [mailto:delphigames@yahoogroups.com]
On Behalf Of Ani_Silvia
Sent: 01 November 2007 09:55
To: delphigames@yahoogroups.com
Subject: [DelphiGames] Dynamic Record



Hi,

In a number of applications I needed a structure like this:

type
MyStructure = record
Num : integer;
Arr : array[0..n] of ...;
Str : array[0..n] of ...;
end;

Basicly it is a record, where a member shows the number of 2+ arrays
(also members of the structure), but it must be dynamic (will be
known in run time, can change over time depends on Numb member).
Also I want Str memmber to come right after Num elements of Arr.

So my question is - how to declare this in Delphi?

One example that I hope most of you are familiar - bitmap file:
<header>
<palette>
<bitmap>
size of <palette> depend of the information in <header>.





This email is intended solely for the person to whom it is addressed and may
contain confidential or legally privileged information. If you are not the
intended recipient, be advised that you have received this email in error and
that any use, dissemination, forwarding, printing or copying of this email is
strictly prohibited. Please notify the author by replying to this email and
destroying all copies of the email and attachments. Access to this email by
anyone else is unauthorised.

Email may be susceptible to data corruption, interception, unauthorised
amendment, viruses and delays or the consequences thereof. Any views or opinions
presented are solely those of the author and do not necessarily represent those
of Grosvenor Technology Ltd.

Grosvenor Technology Ltd. (incorp. Newmark Technology Ltd.) is a company
registered in England with company number 2412554.
The Grosvenor Technology Ltd. Registered Office address is Millars Three,
Southmill Road, Bishop's Stortford, Herts, CM23


[Non-text portions of this message have been removed]

#7557 From: "Ani_Silvia" <ani_silvia@...>
Date: Thu Nov 1, 2007 9:55 am
Subject: Dynamic Record
ani_silvia
Offline Offline
Send Email Send Email
 
Hi,

In a number of applications I needed a structure like this:

type
MyStructure = record
   Num : integer;
   Arr : array[0..n] of ...;
   Str : array[0..n] of ...;
end;

Basicly it is a record, where a member shows the number of 2+ arrays
(also members of the structure), but it must be dynamic (will be
known in run time, can change over time depends on Numb member).
Also I want Str memmber to come right after Num elements of Arr.

So my question is - how to declare this in Delphi?

One example that I hope most of you are familiar - bitmap file:
   <header>
   <palette>
   <bitmap>
size of <palette> depend of the information in <header>.

#7556 From: "Ani_Silvia" <ani_silvia@...>
Date: Thu Nov 1, 2007 8:42 am
Subject: Re: [GDI+] How to make Vertical Linear Gradient with more than two colors
ani_silvia
Offline Offline
Send Email Send Email
 
Hi

This TGradient component is really nice and extremely fast. I would
love to learn how does it things so fast.

However it uses GDI for drawing, which is slow and quite
restrictive. What I'm interested is GDI+. And believe me; with GDI+
you can make much more impressive gradients with just few lines.
I'm on a road to make all (at least 90%) of the fx* from Photoshop
(with it you can you can make all kind of crisp, smooth, shine,….
good looking eye candy things). For now I want to implement drop
shadow and Gradient fx*, because GDI+ has native tools that are very
similar.

Anyway as I said in the previous post – I just started with GDI+.
Yesterday by playing with it I found the answer to my question.
Still all links to GDI+ are very welcome (especially study lessons
or interesting drawing with GDI+

P.S Here is a link to what I mean by Linear Vertical Gradient:
http://picbg.net/pic.php?u=7768tvWhD&i=38256&file=.jpg

P.S.1 Part of my goal - Linear Gradient with custom number of
colors, custom number of distance of colors,  custom vector of
gradient:
http://picbg.net/pic.php?u=7768tvWhD&i=38259&file=.jpg

#7555 From: <win95progman@...>
Date: Tue Oct 30, 2007 6:23 pm
Subject: Re: [DelphiGames] [GDI+] How to make Vertical Linear Gradient with more than two colors
win95progman
Offline Offline
Send Email Send Email
 
Hi,

How you want to apppy this is an important factor. But
you can get some very good source and examples at
Torry or EFG labs.

On Torry there is one FW component that stands out -
Gradient: http://www.torry.net/pages.php?id=156
For the latest version along with a nice .exe demo go
to his home page at
http://delphiarea.com/products/gradient/

There are others on this page as well.




--- Ani_Silvia <ani_silvia@...> wrote:

>
> Hi all,
>
> Recently, I started to study GDI+. It happens that
> impressive things can
> be done with just a few lines of code and good
> enough speed.
>
>
>
> I want to make vertical linear gradient with N
> colors (more than 2
> colors). I can think about two ways:
>
> 1. Make N-1 linear gradients. If you have custom
> shape it will be hard
> to divide it n-1 times, and sounds pretty slow.
>
> 2. Use Path brush. Well, the problem is I cannot
> make linear gradient.
> It always makes spherical.
>
>
>
> The both ways doesn't sound good enough.
>
>
>
> Does somebody have done something like this, or have
> enough experience
> to give me an advice?
>
>
>
> P.S. If you have links with programming of GDI+
> (Delphi, C) I would love
> to examine them.
>
>
>
>
>
> [Non-text portions of this message have been
> removed]
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#7554 From: "Ani_Silvia" <ani_silvia@...>
Date: Tue Oct 30, 2007 10:12 am
Subject: [GDI+] How to make Vertical Linear Gradient with more than two colors
ani_silvia
Offline Offline
Send Email Send Email
 
Hi all,

Recently, I started to study GDI+. It happens that impressive things can
be done with just a few lines of code and good enough speed.



I want to make vertical linear gradient with N colors (more than 2
colors). I can think about two ways:

1. Make N-1 linear gradients. If you have custom shape it will be hard
to divide it n-1 times, and sounds pretty slow.

2. Use Path brush. Well, the problem is I cannot make linear gradient.
It always makes spherical.



The both ways doesn't sound good enough.



Does somebody have done something like this, or have enough experience
to give me an advice?



P.S. If you have links with programming of GDI+ (Delphi, C) I would love
to examine them.





[Non-text portions of this message have been removed]

#7553 From: "Ian Munro" <ian.munro@...>
Date: Fri Sep 21, 2007 2:31 pm
Subject: RE: [DelphiGames] Re: Tile sprite question
ianathome12345
Offline Offline
Send Email Send Email
 
Hello,

     Thanks for your comments (and to Sly's). My program is now starting
to grow and I have a nice bit of scrolling going. As soon as I can get
some decent graphics together I hope to put a short demo up on YouTube.

Ian


Ani_Silvia wrote:

  > Storing the information in the class makes the code more clean and
  > readable. This solution is especially good if you have many
  > instances.
  > On the other hand using static or dynamic data structures to hold
  > frame information gives direct and easy access, which is very good
  > if you would like to optimize the code (like re-writing some pats on
  > assembler).



.

<http://geo.yahoo.com/serv?s=97359714/grpId=406/grpspId=1705006764/msgId
=7552/stime=1190358092/nc1=4507179/nc2=3848643/nc3=4763758>


This email is intended solely for the person to whom it is addressed and may
contain confidential or legally privileged information. If you are not the
intended recipient, be advised that you have received this email in error and
that any use, dissemination, forwarding, printing or copying of this email is
strictly prohibited. Please notify the author by replying to this email and
destroying all copies of the email and attachments. Access to this email by
anyone else is unauthorised.

Email may be susceptible to data corruption, interception, unauthorised
amendment, viruses and delays or the consequences thereof. Any views or opinions
presented are solely those of the author and do not necessarily represent those
of Grosvenor Technology Ltd.

Grosvenor Technology Ltd. (incorp. Newmark Technology Ltd.) is a company
registered in England with company number 2412554.
The Grosvenor Technology Ltd. Registered Office address is Millars Three,
Southmill Road, Bishop's Stortford, Herts, CM23


[Non-text portions of this message have been removed]

Messages 7553 - 7582 of 7611   Newest  |  < Newer  |  Older >  |  Oldest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help