×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    124

    cursor in canvas

    Hi all!
    i custom font in Canvas J2ME already and then i wanna do something like cursor with my custom Font. any idea or code. Please help me to do that.

    Thanks,,
    Raksa

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: cursor in canvas

    Quote Originally Posted by chaoraksa View Post
    Hi all!
    i custom font in Canvas J2ME already and then i wanna do something like cursor with my custom Font. any idea or code. Please help me to do that.

    Thanks,,
    Raksa
    Well you can move ahead like this-
    1.Take the String arrays related containing the values you want to have on the particular key.
    2.In the key pressed get the key code for every key pressed.
    3.then draw the particular string array item of that key code...
    4.In order to draw the next char(value) of that key code will be done according to the system time...
    5.For the cursor you can draw the vertical line..
    6.On every key pressed you have to increase the x-pos of the cursor by the font width per char.

    please check that these line can help you in any means.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    124

    Re: cursor in canvas

    Hi!
    I try this. First i just design a courser with animation i mean in gif file then i put it in my app in Metlet but it not work as my image. What wrong with it?

    Please help.

    Thanks,,
    Raksa

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Smile Re: cursor in canvas

    Quote Originally Posted by chaoraksa View Post
    Hi!
    I try this. First i just design a courser with animation i mean in gif file then i put it in my app in Metlet but it not work as my image. What wrong with it?

    Please help.

    Thanks,,
    Raksa
    Are you loading the gif image?
    Hey try to use the PNG image,rather I would recommend you that just take the image without animation and try ti implement the same.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    124

    Re: cursor in canvas

    hi

    Without animation it will confuse.

    Thanks,,
    Raksa

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: cursor in canvas

    Quote Originally Posted by chaoraksa View Post
    hi

    Without animation it will confuse.

    Thanks,,
    Raksa
    Raksa,I really understand your concern,you just first try to implement this without blinking,then after this you can do this fully implemented.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: cursor in canvas

    you also might consider using a Sprite with an animation, so you could for example use 2-3 images to animate the blinking... that is, if ur using GameCanvas

  8. #8
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Smile Re: cursor in canvas

    Hi,
    Rather taking the sprite and making the application bounded with the newer devices like MIDP 2.0,and CLDC,you can draw the vertical line with the height that you want to take,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  9. #9
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    387

    Re: cursor in canvas

    sorry to say could not get you wht u want to say....will you plz be elobarate
    Thanks and Regards,
    Manjul.

  10. #10
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: cursor in canvas

    Quote Originally Posted by manjul_saini View Post
    sorry to say could not get you wht u want to say....will you plz be elobarate
    You can read the first post of this discussion,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  11. #11
    Regular Contributor
    Join Date
    Jul 2009
    Posts
    55

    Re: cursor in canvas

    Quote Originally Posted by chaoraksa View Post
    hi

    Without animation it will confuse.

    Thanks,,
    Raksa
    chaoraksa,
    If u want to implement the full cursor like functionality on canvas, den u must draw Verical line at the place where u drawing your characters on canvas.Den using timer and timer task just write the logic to blink the cursor(i.e vertical line here),(the logic is like use flags which will draw that verical line White at one go and black at one go...)which wil give blinkin effect to line. And after entering any chararcter on canvas just move that vertical line by the zise of that entered character.

    The logic to blink the cursor changes frm person to person. Do the easiest way u find.

    Thanks,
    Pritesh

Similar Threads

  1. Problem with setFullScreenMode(true) in canvas
    By mramin05 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2008-12-06, 05:45
  2. How to create a partly transparent Canvas to lay on top of another Canvas?
    By mkleijer in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2007-05-22, 07:00
  3. Canvas doesn't show when getWidth/getHeight is used
    By claudio4j in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2003-11-05, 08:41
  4. Major problem with delegation to Canvas
    By bartekn in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2003-10-08, 17:46
  5. 7650 and 3650 Canvas and FullCanvas memory
    By marcilgen in forum Mobile Java General
    Replies: 5
    Last Post: 2003-07-08, 12:24

Posting Permissions

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