Results 1 to 4 of 4

Thread: Moving an image around under a touch

  1. #1

    Default Moving an image around under a touch

    I am playing around with the TouchTestComponent to try better understand the entity/component framework. I am trying to get image/texture to show upon a touch, move around during the touch and then disappear. I am having limited success.

    Is there an example of this I am missing?

    *edit
    Found this posting, but not able to apply this tidbit.
    http://www.rtsoft.com/forums/showthr...esourcemanager

    I am adding an entity variable to the TouchObject and trying to create and destroy based upon the messagetype coming into the OnInput. So far still missing something.
    Last edited by acxsasx; 04-23-2012 at 12:21 AM.

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,340

    Default

    Well, there should be no problem doing bitmaps instead of filled squares. I can't really see what's wrong without code but...

    Keep in mind that if you add entities, they aren't going to draw unless they are A, added as a child to an entity that has draw focus, or B, you add draw focus to them.

    Another way would be to just init a Surface and blit it yourself instead of the rect here:

    Code:
    void TouchTestComponent::DrawTouch(uint32 touchID, CL_Vec2f vPos)
    {
    	DrawFilledSquare(vPos.x, vPos.y, 40, m_touch[touchID].m_color, true);
    	GetBaseApp()->GetFont(FONT_SMALL)->Draw(vPos.x-5, vPos.y-20, toString(touchID), MAKE_RGBA(0,0,0,255)); //<-- change this to something else
    }
    Seth A. Robinson
    Robinson Technologies

  3. #3

    Default Like this?

    void TouchTestComponent:rawTouch(uint32 touchID, CL_Vec2f vPos)
    Surface *pSurf = new Surface();
    pSurf->LoadFile("interface/Cobbles_grey_VL.rttex");
    pSurf->Blit(vPos.x,vPos.y);

    This seems to get me what I need. I was trying to this:

    Entity *pBG = CreateOverlayEntity(GetParent(), "MyEnt", "", vPos.x,vPos.y);

    which left a trail of images all over the place.

  4. #4

    Default Even better ...?

    void TouchTestComponent::DrawTouch(uint32 touchID, CL_Vec2f vPos)
    {
    SurfaceAnim *pSurfAnim = GetResourceManager()->GetSurfaceAnim("interface/Cobbles_grey_VL.rttex");
    pSurfAnim->Blit(vPos.x,vPos.y);
    }

Similar Threads

  1. Moving Platform can't locate TAG
    By Pleng in forum Novashell Game Creation System
    Replies: 4
    Last Post: 12-15-2010, 11:59 AM
  2. Moving focus around
    By Harry in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 07-25-2009, 03:47 AM
  3. Help Need, moving Dink
    By Arjayty in forum RTsoft Tavern
    Replies: 0
    Last Post: 11-05-2008, 11:35 AM
  4. Rendering into my custom image and then drawing this image to the display
    By ValkaVALES in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 07-03-2007, 09:53 AM
  5. The Robinson Touch?
    By in forum Other RTsoft Games
    Replies: 3
    Last Post: 06-19-2003, 02:36 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •