Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AbrahamR, 7th_zorro, dr_panther, 1 invisible), 702 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Question about texts #403219
06/16/12 17:40
06/16/12 17:40
Joined: Aug 2005
Posts: 238
Caermundh Offline OP
Member
Caermundh  Offline OP
Member

Joined: Aug 2005
Posts: 238
I know that I can use size_x & size_y to limit the horizontal and vertical display area of a text, and I can use offset_y to scroll the text vertically. Is there such a thing offset_x to scroll a text horizontally?

Re: Question about texts [Re: Caermundh] #403255
06/17/12 07:41
06/17/12 07:41
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
I don't think there is such a thing as offset_x.

Can't you just change pos_x ? Or is the problem that you want it to move out of the window and not be displayed any more?
The other thing you can try (not tested) is to use a render_target and render onto a (possibly transparent, if you don't want any additional images) panel. Then display that panel instead of displaying the text directly on the screen. It should have the same effect, and if you only do it for a text, it shouldn't be much slower (but don't hold me to that).


~"I never let school interfere with my education"~
-Mark Twain
Re: Question about texts [Re: Germanunkol] #403296
06/17/12 21:00
06/17/12 21:00
Joined: Aug 2005
Posts: 238
Caermundh Offline OP
Member
Caermundh  Offline OP
Member

Joined: Aug 2005
Posts: 238
as you said, i want the text to scroll off the window and not be displayed anymore. I want to be able to scroll a text both horizontally and/or vertically and limit the text display to a given area.

Ive (sort of) found a way to do it copying the string to a temp text and clipping the string using str_clip/str_trunc, then displaying the temp text instead of the real text. it *almost* works - but its kinda painful and clunky.

How would i render text to panel with render_target? I looked up render_target in the manual and it gives me a bunch of shader code - shaders just plain make my brain hurt. I dont understand the concept - let alone the code.

Re: Question about texts [Re: Caermundh] #403301
06/17/12 22:25
06/17/12 22:25
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You can use panel.target_map to render panels into bitmaps.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Question about texts [Re: Superku] #403304
06/17/12 22:59
06/17/12 22:59
Joined: Aug 2005
Posts: 238
Caermundh Offline OP
Member
Caermundh  Offline OP
Member

Joined: Aug 2005
Posts: 238
but how do i convert a text to a bitmap or panel to begin with? or can i use text.target_map to render the text into a bitmap?

Re: Question about texts [Re: Caermundh] #403308
06/18/12 00:00
06/18/12 00:00
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
can i use text.target_map to render the text into a bitmap?

Yes. Did you check the manual?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Question about texts [Re: Superku] #403309
06/18/12 00:30
06/18/12 00:30
Joined: Aug 2005
Posts: 238
Caermundh Offline OP
Member
Caermundh  Offline OP
Member

Joined: Aug 2005
Posts: 238
ok, read the manual - tried the following:

TEXT* test_text =
{ layer = 10;
strings = 1;
string("This is a test string.");
}

PANEL* test_panel =
{ layer = 10;
pos_x = 25;
pos_y = 25;
flags = SHOW;
}

funciton main()
{ test_panel.bmap = test_text.target_map;
}

This didnt work - what am i missing here?

Re: Question about texts [Re: Caermundh] #403310
06/18/12 01:02
06/18/12 01:02
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Your code does not make much sense.

BMAP* my_bitmap = "...";

test_text.target_map = my_bitmap;

Then draw the bitmap in a panel or with draw_quad.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Question about texts [Re: Superku] #403311
06/18/12 01:11
06/18/12 01:11
Joined: Aug 2005
Posts: 238
Caermundh Offline OP
Member
Caermundh  Offline OP
Member

Joined: Aug 2005
Posts: 238
im trying to get the text from the text into a bitmap - IE get the string "this is a test string" into a bmap format.

Re: Question about texts [Re: Caermundh] #403312
06/18/12 01:45
06/18/12 01:45
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
im trying to get the text from the text into a bitmap - IE get the string "this is a test string" into a bmap format.

=>
Quote:
BMAP* my_bitmap = "...";

test_text.target_map = my_bitmap;

Then draw the bitmap in a panel or with draw_quad.



"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1