mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
text_wrap_mode
This commit is contained in:
parent
3089f67286
commit
5bf5ffb1fb
@ -2008,3 +2008,41 @@ operator >> (istream &in, Texture::FilterType &ft) {
|
|||||||
ft = Texture::string_filter_type(word);
|
ft = Texture::string_filter_type(word);
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: Texture::WrapMode output operator
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
ostream &
|
||||||
|
operator << (ostream &out, Texture::WrapMode wm) {
|
||||||
|
switch (wm) {
|
||||||
|
case Texture::WM_clamp:
|
||||||
|
return out << "clamp";
|
||||||
|
case Texture::WM_repeat:
|
||||||
|
return out << "repeat";
|
||||||
|
case Texture::WM_mirror:
|
||||||
|
return out << "mirror";
|
||||||
|
case Texture::WM_mirror_once:
|
||||||
|
return out << "mirror_once";
|
||||||
|
case Texture::WM_border_color:
|
||||||
|
return out << "border_color";
|
||||||
|
|
||||||
|
case Texture::WM_invalid:
|
||||||
|
return out << "invalid";
|
||||||
|
}
|
||||||
|
|
||||||
|
return out << "(**invalid Texture::WrapMode(" << (int)wm << ")**)";
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: Texture::WrapMode input operator
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
istream &
|
||||||
|
operator >> (istream &in, Texture::WrapMode &wm) {
|
||||||
|
string word;
|
||||||
|
in >> word;
|
||||||
|
|
||||||
|
wm = Texture::string_wrap_mode(word);
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
@ -414,6 +414,9 @@ private:
|
|||||||
EXPCL_PANDA ostream &operator << (ostream &out, Texture::FilterType ft);
|
EXPCL_PANDA ostream &operator << (ostream &out, Texture::FilterType ft);
|
||||||
EXPCL_PANDA istream &operator >> (istream &in, Texture::FilterType &ft);
|
EXPCL_PANDA istream &operator >> (istream &in, Texture::FilterType &ft);
|
||||||
|
|
||||||
|
EXPCL_PANDA ostream &operator << (ostream &out, Texture::WrapMode wm);
|
||||||
|
EXPCL_PANDA istream &operator >> (istream &in, Texture::WrapMode &wm);
|
||||||
|
|
||||||
#include "texture.I"
|
#include "texture.I"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -171,6 +171,9 @@ ConfigVariableEnum<Texture::FilterType> text_minfilter
|
|||||||
ConfigVariableEnum<Texture::FilterType> text_magfilter
|
ConfigVariableEnum<Texture::FilterType> text_magfilter
|
||||||
("text-magfilter", Texture::FT_linear,
|
("text-magfilter", Texture::FT_linear,
|
||||||
PRC_DESC("The default texture magfilter type for dynamic text fonts"));
|
PRC_DESC("The default texture magfilter type for dynamic text fonts"));
|
||||||
|
ConfigVariableEnum<Texture::WrapMode> text_wrap_mode
|
||||||
|
("text-wrap-mode", Texture::WM_border_color,
|
||||||
|
PRC_DESC("The default wrap mode for dynamic text fonts"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ extern ConfigVariableInt text_max_never_break;
|
|||||||
|
|
||||||
extern ConfigVariableEnum<Texture::FilterType> text_minfilter;
|
extern ConfigVariableEnum<Texture::FilterType> text_minfilter;
|
||||||
extern ConfigVariableEnum<Texture::FilterType> text_magfilter;
|
extern ConfigVariableEnum<Texture::FilterType> text_magfilter;
|
||||||
|
extern ConfigVariableEnum<Texture::WrapMode> text_wrap_mode;
|
||||||
|
|
||||||
extern EXPCL_PANDA void init_libtext();
|
extern EXPCL_PANDA void init_libtext();
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ DynamicTextPage(DynamicTextFont *font, int page_number) :
|
|||||||
|
|
||||||
// Clamp to an explicit invisible border, so we don't get bleeding
|
// Clamp to an explicit invisible border, so we don't get bleeding
|
||||||
// at the edges at all.
|
// at the edges at all.
|
||||||
set_wrap_u(WM_border_color);
|
set_wrap_u(text_wrap_mode);
|
||||||
set_wrap_v(WM_border_color);
|
set_wrap_v(text_wrap_mode);
|
||||||
set_border_color(Colorf(0.0f, 0.0f, 0.0f, 0.0f));
|
set_border_color(Colorf(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user