Editing method and device for text in virtual environment, terminal, medium and product
By using a sub-text editing interface and editing controls in a virtual environment and sharing virtual engine instance objects, the problems of cumbersome user operations and performance pressure are solved, editing efficiency is improved and the burden on the virtual engine is reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, editing rich text in game scenes is cumbersome and inefficient, and multiple textpad areas put excessive pressure on the virtual engine's performance.
By displaying a sub-text editing interface in a virtual environment and using editing controls to set text display effects, all sub-texts share a single virtual engine instance object, avoiding the creation of multiple Actors and simplifying user operations.
It improves the efficiency of text editing in the virtual environment, reduces the performance consumption of the virtual engine, and simplifies the user operation process.
Smart Images

Figure CN121858097A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of human-computer interaction, and in particular to a method, apparatus, terminal, medium and product for editing text in a virtual environment. Background Technology
[0002] In gaming, user-generated content (UGC) refers to content created by users themselves to participate in the design of game content such as level maps, gameplay, and the ecosystem. For example, a user creates text in a writing pad area, and the terminal displays the text in that area.
[0003] In a text, there are often words or phrases that users want to emphasize. To make different phrases display with different rich text formats (such as bold, highlight, underline, font size, font color or font style, etc.), related technologies require users to edit different phrases separately in multiple text editor areas, set corresponding rich text formats for different phrases, and finally manually concatenate the phrases into a whole text.
[0004] However, using the above method to edit rich text format to achieve different text display effects for different phrases is cumbersome and inefficient. On the other hand, multiple textpad areas correspond to multiple Actors (instance objects in the virtual engine) in the game engine, causing additional performance pressure. Summary of the Invention
[0005] This application provides a method, apparatus, terminal, medium, and product for editing text in a virtual environment. The technical solution is as follows:
[0006] On one hand, embodiments of this application provide a method for editing text in a virtual environment, the method comprising:
[0007] Display the original text in edit mode within a virtual environment;
[0008] In response to the selection operation of the first sub-text in the original text, the sub-text editing interface corresponding to the first sub-text is displayed, and the sub-text editing interface includes at least one editing control for setting the text display effect of the sub-text;
[0009] In response to an editing operation on the editing control in the sub-text editing interface corresponding to the first sub-text, the original text with updated effect is displayed in the virtual environment, wherein the first sub-text in the original text with updated effect has the text display effect indicated by the editing operation.
[0010] On the other hand, embodiments of this application provide a text editing device in a virtual environment, the device comprising:
[0011] The raw text display module is used to display raw text that is in editing mode in a virtual environment;
[0012] The subtext editing interface display module is used to display the subtext editing interface corresponding to the first subtext in response to the selection operation of the first subtext in the original text. The subtext editing interface includes at least one editing control for setting the text display effect of the subtext.
[0013] The original text display module is further configured to respond to an editing operation of the editing control in the sub-text editing interface corresponding to the first sub-text, and display the updated original text in the virtual environment, wherein the first sub-text in the updated original text has the text display effect indicated by the editing operation.
[0014] On the other hand, embodiments of this application provide a terminal, the terminal including a processor and a memory, the memory storing at least one computer instruction, the at least one computer instruction being loaded and executed by the processor to implement the method as described above.
[0015] On the other hand, embodiments of this application provide a computer-readable storage medium storing at least one computer instruction, which is loaded and executed by a processor to implement the method described above.
[0016] On the other hand, embodiments of this application provide a computer program product including computer instructions stored in a computer-readable storage medium. A terminal's processor reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the terminal to perform the methods provided in the various optional implementations of the above aspects.
[0017] In this embodiment, on the one hand, since each sub-text in the original text corresponds to the same instance object (Actor) in the virtual engine, the user can set the text display effect of each sub-text separately through the method provided in this embodiment. Therefore, the virtual engine does not need to create multiple different Actors to set the text display effect of different sub-texts, thus avoiding the waste of virtual engine performance. On the other hand, through the editing controls in the sub-text editing interface, the user does not need to manually input cumbersome decoration code. The user can simply edit the text display effect of the sub-text through simple editing operations of the editing controls, thereby improving the efficiency of text editing in the virtual environment. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a diagram illustrating how users manually input modifier codes to set rich text formatting in related technologies;
[0020] Figure 2 This is a flowchart of a text editing method in a virtual environment provided in an exemplary embodiment of this application;
[0021] Figure 3 This is a schematic diagram of a text editing method in a virtual environment provided by an exemplary embodiment of this application;
[0022] Figure 4 This is a schematic diagram of a rich text editing interface provided in an exemplary embodiment of this application;
[0023] Figure 5 This is a schematic diagram illustrating the determination of original text as subtext in response to the first operation of a subtext editing enable control, provided by an exemplary embodiment of this application.
[0024] Figure 6 This is a schematic diagram illustrating the addition of subtext to original text via a subtext addition control, provided in an exemplary embodiment of this application.
[0025] Figure 7 This is a schematic diagram of a newly added sub-text editing interface provided in an exemplary embodiment of this application;
[0026] Figure 8 This is a schematic diagram of a rich text editing interface provided in an exemplary embodiment of this application, which includes a subtext deletion control and a text display effect reset control;
[0027] Figure 9 This is a schematic diagram illustrating the adjustment of the position of subtext within the original text using a sequence adjustment control, provided in an exemplary embodiment of this application.
[0028] Figure 10 This is a schematic diagram illustrating a method for switching the subtext editing interface using a subtext switching control, provided in an exemplary embodiment of this application.
[0029] Figure 11This is a flowchart illustrating the technical aspects of displaying the updated original text in a virtual environment in response to an editing operation of an editing control in the subtext editing interface corresponding to the first subtext, as provided in an exemplary embodiment of this application.
[0030] Figure 12 This is a schematic diagram illustrating the editing of raw text in a wordpad through a visual programming interface, provided by an exemplary embodiment of this application.
[0031] Figure 13 This is a structural block diagram of a text editing device in a virtual environment provided in an exemplary embodiment of this application;
[0032] Figure 14 This is a schematic diagram of the structure of a terminal 1400 provided in an exemplary embodiment of this application. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0034] First, the terms used in the embodiments of this application will be introduced.
[0035] Rich Text Format (RTF): Also known as multi-text format, as opposed to plain text, it can record style, layout, and other information. It uses modifier symbols to represent different text display effects, such as font color, font style (bold, italic, etc.), font size, and font characteristics (e.g., hyperlinks). For example, modifying the code symbol "<color=#FF0000> "This indicates that the font color is red."
[0036] Virtual engine: A software framework that provides fast and efficient rendering and animation capabilities for virtual environments. For example, in a game scenario, a virtual engine can be a game engine such as Unity or Unreal Engine. Similarly, in a virtual reality scenario, a virtual engine can be a virtual reality engine such as Unreal Engine or SteamVR.
[0037] In the virtual engine, an instance object (Actor) is one of the most important concepts. Every object in the virtual world corresponds to an Actor, which can be considered an "actor" in the virtual world. For example, a writing pad area in the virtual environment is an Actor, or a virtual character or virtual object is an Actor. Different Actors inherit from the same high-level abstract class.
[0038] User-generated content (UGC) generally refers to content created and generated by users themselves. In game scenarios, designers encourage users to participate in the design of game content such as level maps, gameplay, and the ecosystem by providing necessary mechanisms and corresponding UGC editing capabilities within the game.
[0039] Writing pad: A component in the game scene with UGC editing capabilities. Users can use the writing pad to edit text and display the writing pad area containing the text in the virtual environment.
[0040] In game scenarios in related technologies that include UGC functionality, users can create text in a textpad area, which the terminal then displays. To ensure that different phrases within a single text segment are displayed using different rich text formats, users need to edit different phrases separately in multiple textpad areas, set corresponding rich text formats for each phrase, and finally manually concatenate the phrases into a single text segment.
[0041] Typically, users can manually edit formatting codes to set different rich text formats for different phrases. For example, for the phrase "example text", the formatting code "<color=#FF0000> Example text <color>Modifying this phrase will cause the terminal to ultimately display "Example Text" in red font.
[0042] See Figure 1 , Figure 1 This is a diagram illustrating how users manually input modifier codes to set rich text formatting in related technologies.
[0043] like Figure 1 As shown, the user manually enters the modifier code 102 via the virtual keyboard 101 to set the font color of the phrase "sample text" to red, and the terminal displays the red "sample text" in the writing pad 103.
[0044] Similarly, when a user wants to set rich text format for other phrases, they can use other word processing software to edit other phrases and manually enter the corresponding modifier codes in a similar way to set the rich text format for other phrases. Finally, they can manually concatenate multiple phrases from multiple word processing software to obtain a whole text containing phrases with different rich text formats.
[0045] However, using the above method to edit rich text format to achieve different text display effects for different phrases is cumbersome and inefficient because it requires users to manually input modifier codes and manually concatenate different phrases. At the same time, multiple textpad areas correspond to multiple Actors (instance objects in the game engine) in the game engine, causing additional performance pressure.
[0046] Therefore, in order to improve the efficiency of rich text editing in a virtual environment and reduce the performance pressure on the game engine, this application provides a method for editing text in a virtual environment.
[0047] See Figure 2 , Figure 2 This is a flowchart of a text editing method in a virtual environment provided by an exemplary embodiment of this application. In some embodiments, the method is executed by a terminal, and the method includes the following steps.
[0048] Step 201: Display the original text in edit mode in the virtual environment.
[0049] In one possible scenario, the virtual environment is a game virtual environment within a game scene. The terminal can display raw text in an editing state on virtual objects within the virtual environment. Optionally, virtual objects include a writing tablet, walls, floors, or any other possible objects.
[0050] Optionally, in response to receiving a trigger operation on the original text on the virtual object, the terminal displays the original text in an editing state.
[0051] Optionally, the terminal can display editable identifiers such as cursor icons to indicate that the original text is in an editing state.
[0052] See Figure 3 , Figure 3 This is a schematic diagram of a text editing method in a virtual environment provided by an exemplary embodiment of this application.
[0053] like Figure 3 As shown, in response to a trigger operation on the writing pad 301 in the virtual environment, the writing pad 301 displays the original text "This is subtext 1 This is subtext 2 This is subtext 3" in an editing state. The user can edit the text content of the original text in the writing pad 301.
[0054] In some embodiments, the original text within the same wordpad in the virtual engine corresponds to one Actor. For example, "This is subtext 1" and "This is subtext 2" within the original text correspond to the same Actor.
[0055] Step 202: In response to the selection operation of the first sub-text in the original text, the sub-text editing interface corresponding to the first sub-text is displayed. The sub-text editing interface includes at least one editing control for setting the text display effect of the sub-text.
[0056] Optionally, the first subtext can be part or all of the text in the original text. For example, if the original text is "This is subtext 1 This is subtext 2 This is subtext 3", then the first subtext can be either "This is subtext 1" or "This is subtext 1 This is subtext 2 This is subtext 3". Optionally, the text within the first subtext can include one or more text characters.
[0057] Regarding the specific method for selecting the first sub-text in the original text, one possible implementation is that the user can select the first sub-text by clicking. For example, the user can use the cursor to select the first character and the last character of the first sub-text to select it.
[0058] Regarding the specific method for selecting the first subtext in the original text, in another possible implementation, the terminal also displays a rich text editing interface. The user can also trigger the subtext editing entry corresponding to the first subtext in the rich text editing interface to select the first subtext. Besides this, the user can select the first subtext in any other possible way, without restriction.
[0059] The sub-text editing interface corresponding to the first sub-text can be used to edit the text content of the first sub-text and the text display effects, such as font color, font, size, bold, italic, and other text display effects.
[0060] like Figure 3 In response to the selection of the first subtext "This is subtext 1" within the original text in the writing pad 301, the terminal displays the subtext editing interface 302 corresponding to the first subtext. The subtext editing interface 302 includes an editing area for editing the text content of the first subtext, as well as editing controls for editing the text display effects of the first subtext. Examples include font controls, text size controls, text bold controls, text color controls, text stroke thickness controls, underline controls, etc.
[0061] For example, when the text size control indicates that the text size of the first sub-text is 35, the text size of the first sub-text in the original text displayed in the WordPad 301 is 35.
[0062] Step 203: In response to the editing operation of the editing control in the subtext editing interface corresponding to the first subtext, the original text with the updated effect is displayed in the virtual environment, wherein the first subtext in the original text with the updated effect has the text display effect of the editing operation indication.
[0063] Regarding the specific methods for editing the editing controls in the sub-text editing interface corresponding to the first sub-text, optionally, the user can drag the editing control to select the corresponding attribute value. For example, for the text size editing control, the user can drag the text size selection progress bar to select the appropriate font size.
[0064] Regarding the specific methods for editing the editing controls in the sub-text editing interface corresponding to the first sub-text, optionally, users can also perform editing operations on the editing controls by inputting attribute values. For example, for the text size editing control, users can also manually input the number corresponding to the text size.
[0065] like Figure 3 In response to a user's editing operation on an editing control (text size control) in the sub-text editing interface 302, changing the text size from 35 to 37, the terminal displays the updated original text in the textpad 301. In the updated original text, the text size of the first sub-text "This is sub-text 1" is changed to 37, while the text size of the other sub-texts "This is sub-text 2 This is sub-text 3" remains at 35.
[0066] In summary, on the one hand, since each sub-text within the original text corresponds to the same instance object (Actor) in the virtual engine, the method provided in this embodiment allows users to set the text display effects for each sub-text using the same Actor. Therefore, the virtual engine does not need to create multiple different Actors to set the text display effects for different sub-texts, avoiding wasted virtual engine performance. On the other hand, through the editing controls in the sub-text editing interface, users do not need to manually input cumbersome modification code; they can simply edit the text display effects of the sub-text through simple editing operations on the editing controls, improving the efficiency of text editing within the virtual environment.
[0067] In game scenarios, users don't frequently edit the text display of sub-text using the text editor. To prevent accidental touches, some implementations may include a sub-text editing enable control. The user can only edit the text display of individual sub-texts within the original text when the terminal receives an enable operation on the sub-text editing enable control.
[0068] In some embodiments, the terminal displays a rich text editing interface corresponding to the original text.
[0069] Optionally, the rich text editing interface may include a sub-text editing enable control.
[0070] In one possible implementation, the terminal displays a rich text editing interface while simultaneously displaying the original text, for example, via a side pop-up. In another possible implementation, the terminal displays the rich text editing interface upon receiving a wake-up operation. For example, the wake-up operation could be a keyboard shortcut, a control activation operation, etc., and there are no restrictions on this.
[0071] See Figure 4 , Figure 4 This is a schematic diagram of a rich text editing interface provided in an exemplary embodiment of this application.
[0072] As shown in the figure, the terminal displays a notebook 410 in a virtual environment. The original text in the notebook 410 is "This is subtext 1 This is subtext 2". The terminal also displays a rich text editing interface 420 corresponding to the original text.
[0073] In some embodiments, the rich text editing interface 420 can be used to edit the text content of the entire original text and the text display effects common to the entire original text. For example, a user can set the font of the entire original text by clicking the font control 422 in the rich text editing interface 420. As another example, a user can set the text size of the entire original text by using the text size control 423 in the rich text editing interface 420. As yet another example, a user can set the horizontal alignment of the entire original text by using the horizontal alignment control 424 in the rich text editing interface 420.
[0074] In some embodiments, the rich text editing interface includes a subtext editing enable control. In response to enabling the subtext editing enable control in the rich text editing interface, the terminal displays subtext editing entries corresponding to each subtext in the rich text editing interface. Each subtext editing entry includes a subtext editing entry control.
[0075] like Figure 4 In the rich text editing interface 420, when the terminal receives an operation to enable the subtext editing control 421, the terminal displays the subtext editing entry 425 corresponding to subtext 1 and the subtext editing entry 426 corresponding to subtext 2 in the rich text editing interface 420. Subtext editing entry 425 contains the subtext editing entry control 425-1 corresponding to subtext 1, and subtext editing entry 426 contains the subtext editing entry control 426-1 corresponding to subtext 2.
[0076] In some embodiments, in response to a triggering operation on the subtext editing entry control corresponding to the first subtext in the rich text editing interface, the terminal displays the subtext editing interface corresponding to the first subtext.
[0077] For example, when the terminal receives a trigger operation on the subtext editing control 425-1 corresponding to subtext 1, the terminal displays the subtext editing interface corresponding to subtext 1. The subtext editing interface includes editing controls for setting the text display effects of subtext 1. For example, editing controls for setting text display effects such as font color, font, size, bold, italic, etc.
[0078] Regarding the method of dividing the original text into sub-texts, in some embodiments, the terminal uses the text content entered by the user based on the first sub-text editing entry as the first sub-text, the text content entered by the user based on the second sub-text editing entry as the second sub-text, and so on, to obtain the various sub-texts in the original text.
[0079] In other embodiments, the terminal may also determine the division of each subtext in the original text based on other methods before the user enters text content based on the subtext editing entry.
[0080] In one possible scenario, in response to a non-first-time enabling operation of the subtext editing enable control in the rich text editing interface, the terminal divides the original text into at least one subtext and displays the subtext editing entries corresponding to each subtext in the rich text editing interface.
[0081] Regarding the specific method for dividing the original text into at least one subtext, in some embodiments, in response to a non-first-time enabling operation of the subtext editing enable control in the rich text editing interface, the terminal divides the original text into at least one subtext by semantic recognition of the original text.
[0082] For example, a terminal can use a deployed large language model to perform semantic recognition on the original text and segment the original text into different sub-texts based on semantics. For instance, if the original text is "The weather is really nice today", the terminal can segment the original text into the sub-text "today", the sub-text "weather", and the sub-text "really nice" based on semantics.
[0083] In some embodiments, in response to a non-first-time enabling operation of a subtext editing enable control in a rich text editing interface, the terminal divides the original text into at least one subtext based on a subtext segmentation operation.
[0084] For example, users can manually divide the original text into different subtexts.
[0085] In another possible implementation, in response to the first enabling operation of the subtext editing enable control in the rich text editing interface, the terminal determines the original text as subtext and displays the subtext editing entry corresponding to the original text in the rich text editing interface.
[0086] See Figure 5 , Figure 5 This is a schematic diagram provided by an exemplary embodiment of the present application, illustrating the determination of original text as subtext in response to the first operation of a subtext editing enable control.
[0087] like Figure 5 As shown, when the subtext editing enable control 521 in the rich text editing interface 520 is closed, if the original text in the writing pad 510 is "This is a piece of original text", then when the terminal receives the first enable operation of the subtext editing enable control 521, the terminal will treat the original text as a subtext and display the subtext editing entry 522 corresponding to the original text.
[0088] To add subtext to the original text, in some embodiments, in response to an enabling operation of the subtext editing enable control in the rich text editing interface, the terminal displays the subtext adding control in the rich text editing interface.
[0089] For example, when the terminal receives an enable operation on the subtext editing enable control 521, the terminal displays the subtext adding control 523 in the rich text editing interface 520.
[0090] See Figure 6 , Figure 6 This is a schematic diagram illustrating the addition of subtext to original text using a subtext addition control, provided in an exemplary embodiment of this application.
[0091] like Figure 6 As shown, the original text in the writing pad 610 displayed on the terminal is "This is a whole piece of original text". When the terminal receives the first enable operation of the subtext editing enable control in the rich text editing interface 620, it displays the subtext addition control 622 in the rich text editing interface 620. The rich text editing interface 620 also displays the subtext editing entry 621 corresponding to the original text (as subtext).
[0092] In some embodiments, in response to a triggering operation of adding a control to subtext, the terminal displays the subtext editing entry corresponding to the newly added subtext.
[0093] For example, when a trigger operation is received to add a control 622 to the subtext, the terminal displays the subtext editing entry 623 corresponding to the newly added text.
[0094] In some embodiments, in response to a triggering operation on the subtext editing entry control in the subtext editing entry corresponding to the newly added subtext, the newly added subtext editing interface corresponding to the newly added subtext is displayed.
[0095] For example, in response to the triggering operation of the sub-text editing entry control 623-1 corresponding to the newly added text, the terminal displays the newly added sub-text editing interface corresponding to the newly added text.
[0096] See Figure 7 , Figure 7 This is a schematic diagram of a newly added sub-text editing interface provided in an exemplary embodiment of this application.
[0097] like Figure 7 As shown, the newly added sub-text editing interface 720 can be used to input the text content corresponding to the newly added text, and can also be used to set the text display effect of the newly added text through various editing controls.
[0098] In some embodiments, in response to a text input operation of entering a second subtext in a new subtext editing interface, the original text is synchronously updated in a virtual environment, and the updated original text includes the second subtext.
[0099] For example, when a user enters "This is the newly added text" as the second subtext in the newly added subtext editing interface 720, the original text displayed in the writing pad 610 in the virtual environment is updated synchronously, and the updated original text changes to "This is a whole paragraph of original text. This is the newly added text".
[0100] In this embodiment, when an enable operation is received for the subtext editing enable control in the rich text editing interface, the terminal can provide the subtext editing entry control for each subtext by displaying the subtext editing entries corresponding to each subtext in the rich text editing interface; when a trigger operation is received for the subtext editing entry control, the terminal displays the subtext editing interface, through which the text content of the subtext and the text display effects of the text can be set, thereby improving the efficiency of setting the text display effects of each subtext in the original text.
[0101] In some embodiments, in response to the deactivation operation of the subtext editing enable control in the rich text editing interface, the display of the subtext editing entries corresponding to each subtext in the rich text editing interface is stopped.
[0102] Optionally, the disable operation can be a shutdown operation on the subtext editing enable control.
[0103] For example Figure 4 In the case where the user closes the subtext editing enable control 421 in the rich text editing interface 420, the terminal stops displaying the subtext editing entry 425 corresponding to subtext 1 and the subtext editing entry 426 corresponding to subtext 2.
[0104] In some embodiments, when a de-enable operation is received from the sub-text editing enable control, the terminal continues to display the editing controls used to uniformly edit the text display effect of the entire original text. For example, the terminal still displays the font control 422 for setting the font of the entire original text, the text size control 423 for setting the text size of the entire original text, and the horizontal alignment control 424 for setting the horizontal alignment of the entire original text.
[0105] Therefore, by de-enabling the sub-text editing enable control in the rich text editing interface, users can easily set the text display method of the entire original text; by enabling the sub-text editing enable control in the rich text editing interface, users can easily set the text display method of each sub-text in the original text. Thus, the sub-text editing enable control can improve the efficiency of text editing in a virtual environment.
[0106] To enhance the management of individual subtexts and their display effects within the original text, in some embodiments, the subtext editing entry also includes a subtext deletion control and a text display effect reset control.
[0107] The subtext deletion control is used to delete the corresponding subtext editing item in the rich text editing interface, and to delete the corresponding subtext in the original text.
[0108] The text display effect reset control is used to reset the text display effect of each sub-text in the original text.
[0109] See Figure 8 , Figure 8 This is a schematic diagram of a rich text editing interface provided in an exemplary embodiment of this application, which includes a subtext deletion control and a text display effect reset control.
[0110] like Figure 8 As shown, the rich text editing page 820 displays a first sub-text editing entry corresponding to the first sub-text ("This is the first paragraph of text") and a second sub-text editing entry corresponding to the second sub-text ("The second paragraph of text"). The first sub-text editing entry has a sub-text deletion control 821, and the second sub-text editing entry has a sub-text deletion control 822.
[0111] In some embodiments, in response to a triggering operation of a subtext deletion control corresponding to a first subtext in a rich text editing interface, the first subtext is deleted from the original text, and the subtext editing entry corresponding to the first subtext is deleted in the rich text editing interface.
[0112] For example, when the terminal receives a trigger operation on the subtext deletion control 821, it deletes the first subtext from the original text "This is the first paragraph, the second paragraph" in the textpad 810, displays the remaining "the second paragraph", and deletes the first subtext editing entry in the rich text editing interface 820. Alternatively, when the terminal receives a trigger operation on the subtext deletion control 822, it deletes the second subtext from the original text "This is the first paragraph, the second paragraph" in the textpad 810, displays the remaining "This is the first paragraph", and deletes the second subtext editing entry in the rich text editing interface 820.
[0113] Users can efficiently delete any subtext from the original text using the subtext deletion control in the subtext editing entry corresponding to each subtext.
[0114] In some embodiments, in response to a triggering operation of a text display effect reset control, the original text after effect reset is displayed in a virtual environment, wherein each subtext in the original text after effect reset has a default text display effect.
[0115] For example, when the terminal receives a trigger operation on the text display effect reset control 821 in the rich text editing interface 820, the terminal resets the text display effect of each sub-text in the original text to the default text display effect in the writing pad 810.
[0116] Optionally, the default text display effect can be the text display effect preset by the terminal, such as the font being KaiTi and the text size being 35.
[0117] Similarly, in some embodiments, a subtext display effect reset control can be displayed in the subtext editing interface corresponding to each subtext. When the terminal receives a trigger operation on the subtext display effect reset control in the subtext editing interface, it resets the text display effect corresponding to that subtext to the default text display effect in the WordPad, while maintaining the current text display effect for other subtexts, thereby achieving more refined management of the text display effect corresponding to each subtext in the original text.
[0118] In some embodiments, a user can copy the text content of each subtext in the original text, as well as the rich text formatting of the subtext, and copy the original text with rich text formatting to other areas.
[0119] In some embodiments, in response to a text copy operation on the original text, the terminal copies the format string corresponding to the original text.
[0120] The format string represents the text within each subtext of the original text and the rich text format that the subtext has.
[0121] For example, the format string "<c=#FF0000><s=35> The text display style corresponding to "Example Text 1" represents the original text, including a red font color and a text size of 35.
[0122] Optionally, in response to a triggering operation on the copy control in the rich text editing interface, the terminal copies the format string corresponding to the original text.
[0123] For example, when a user triggers the copy control 831 in the rich text editing interface 820, the terminal copies the format string corresponding to the original text in the wordpad 810.
[0124] In some embodiments, in response to a text paste operation in a paste area, the original text is displayed in the paste area, wherein each subtext in the original text has a corresponding rich text format.
[0125] Optionally, the paste area can be any area that supports paste format strings. For example, the paste area can be the current WordPad or another WordPad, or it can be any other text editing area that supports rich text formatting, such as other virtual objects, without any restrictions.
[0126] To adjust the order of the sub-texts in the original text, in some embodiments, the sub-text editing interface also includes an order adjustment control.
[0127] The order adjustment control is used to adjust the position of subtext within the original text.
[0128] Optionally, the order adjustment controls include a forward order control and a backward order control.
[0129] In some embodiments, in response to a triggering operation of a sequence adjustment control in the subtext editing interface, the position of the subtext in the original text is adjusted based on the sequence indicated by the sequence adjustment control.
[0130] See Figure 9 , Figure 9 This is a schematic diagram illustrating the adjustment of the position of subtext within the original text using a sequence adjustment control, provided in an exemplary embodiment of this application.
[0131] like Figure 9 As shown, the terminal displays the original text "This is subtext 1 This is subtext 2 This is subtext 3" in the writing pad 910-1 within the virtual environment. The first subtext "This is subtext 1" is selected, and the terminal also displays the subtext editing interface corresponding to the first subtext. The subtext editing interface includes a forward sequence control 921-1 and a backward sequence control 922-1.
[0132] Since the first subtext "This is subtext 1" is the first subtext in the original text, the current order forward control 921-1 is in an untriggerable state. When the user triggers the order backward control 922-1, the terminal moves the first subtext after the second subtext in the writing pad 910-1, i.e. Figure 9 The original text displayed in the writing pad 910-2 after the sequential movement is "This is subtext 2 This is subtext 1 This is subtext 3". At this time, the first subtext "This is subtext 1" is also selected, and the terminal still displays the subtext editing interface corresponding to the first subtext. Both the forward movement control 921-2 and the backward movement control 922-2 in the subtext editing interface are triggerable. For example, if the user triggers the forward movement control 921-2, the terminal will move the first subtext in the writing pad before the second subtext. Or, if the user triggers the backward movement control 922-2, the terminal will move the first subtext in the writing pad after the third subtext.
[0133] In this embodiment, the user can easily adjust the order of each sub-text in the original text using the order adjustment control, which has high efficiency in adjusting the order of sub-texts.
[0134] To further improve the efficiency of text editing in a virtual environment, in some embodiments, a subtext switching control can be used to switch the subtext editing interface currently displayed on the terminal.
[0135] In some embodiments, when a subtext editing interface is displayed, the subtext corresponding to the subtext editing interface in the original text displayed in the virtual environment has a selection mark, and the subtext editing interface also includes a subtext switching control.
[0136] In some embodiments, in response to a triggering operation of a subtext switching control in the subtext editing interface, the terminal switches to display the subtext editing interface corresponding to the adjacent subtext of the subtext in the original text, and the adjacent subtext in the original text displayed in the virtual environment has a selection mark.
[0137] See Figure 10 , Figure 10 This is a schematic diagram illustrating a method for switching the subtext editing interface using a subtext switching control, provided in an exemplary embodiment of this application.
[0138] like Figure 10 As shown, the terminal displays the original text "This is subtext 1 This is subtext 2 This is subtext 3" in the writing pad 1010-1 within the virtual environment. The first subtext "This is subtext 1" is selected, and the terminal also displays the subtext editing interface 1020-1 corresponding to the first subtext "This is subtext 1". In the subtext editing interface 1020-1, subtext switching controls are displayed, including a previous subtext switching control 1021-1 and a next subtext switching control 1022-1.
[0139] Since the current first sub - text is the first sub - text in the original text, the current previous sub - text switching control 1021 - 1 is in a non - triggerable state. When the terminal receives a trigger operation from the user on the next sub - text switching control 1022 - 1, the terminal determines that the second sub - text "This is sub - text 2" has a selected identifier, and at the same time switches the sub - text editing interface 1020 - 1 corresponding to the first sub - text to the sub - text editing interface 1020 - 2 corresponding to the second sub - text.
[0140] At this time, both the previous sub - text switching control 1021 - 2 and the next sub - text switching control 1022 - 2 in the sub - text editing interface 1020 - 2 are in a triggerable state. For example, when the user triggers the previous sub - text switching control 1021 - 2, the terminal will re - determine that the first sub - text has a selected identifier and switch the sub - text editing interface corresponding to the second sub - text back to the sub - text editing interface corresponding to the first sub - text. When the user triggers the next sub - text switching control 1022 - 2, the terminal determines that the third sub - text "This is sub - text 3" has a selected identifier and switches the sub - text editing interface corresponding to the second sub - text to the sub - text editing interface corresponding to the third sub - text.
[0141] In this embodiment, through the sub - text switching control in the sub - text editing interface, the user can quickly switch the sub - text editing interface to achieve editing of different sub - texts in the original text.
[0142] See Figure 11 , Figure 11 is a technical - side flowchart of updating the display effect of the original text in a virtual environment in response to an editing operation on an editing control in the sub - text editing interface corresponding to the first sub - text provided by an exemplary embodiment of the present application. The process includes the following steps.
[0143] Step 1110, in response to an editing operation on an editing control in the sub - text editing interface corresponding to the first sub - text, determine the first rich - text format indicated by the editing operation.
[0144] In some embodiments, different types of editing controls correspond to different types of rich - text formats respectively. For example, for a font - color editing control, its corresponding rich - text format is "<color = ‘#code corresponding to the font color’>"; for a text - size editing control, its corresponding rich - text format is "<size = ‘#number corresponding to the text size’>".
[0145] It should be noted that the correspondence between the editing control and the rich - text format can be pre - defined by the terminal; at the same time, the rich - text format can be either a format defined by the terminal or a standard format commonly used for rich - text, and this is not limited.
[0146] In one possible implementation, since the rich text format can be a terminal-defined format, in order to reduce the amount of data when storing text, in some embodiments, in response to the text storage operation on the original text, the terminal converts the original format string corresponding to the original text into a shortened format string for storage.
[0147] The abbreviated format string has fewer characters than the original format string, and both the original and abbreviated format strings indicate the same rich text format.
[0148] For example, the original format string corresponding to the original text is "<color=#FF0000><size=35> Example text 1", abbreviation format string is "<c=#FF0000><s=35> The rich text formatting of "Example Text 1" indicates that the text display style of "Example Text 1" is red font color and text size is 35, but the abbreviated format string has fewer characters, so it can occupy less data when storing text, thereby improving text storage efficiency.
[0149] Step 1120: Based on the first rich text format and the first subtext, update the original format string corresponding to the original text to obtain the updated format string.
[0150] For example only, the original text is "subtext1subtext2", and the original format string is "<color=‘#FF0000’> Subtext 1 <color><color=‘#FFFFFF’>Subtext 2 <color>The quotation marks indicate that the text corresponding to subtext 1 is displayed in red, and the text corresponding to subtext 2 is displayed in white.
[0151] In some embodiments, upon receiving an editing operation from a user on the font color editing control in the subtext editing interface corresponding to subtext 1, the terminal obtains the first rich text format of the editing operation instruction.<color=‘#000000’> If the font color is black, then based on the first rich text format and the first subtext, the original format string corresponding to the original text is updated, resulting in the updated format string "".<color=‘#000000’> Subtext 1 <color><color=‘#FFFFFF’>Subtext 2 <color>The quotation marks indicate that the text corresponding to subtext 1 is displayed in black, and the text corresponding to subtext 2 is displayed in white.
[0152] Step 1130: Determine whether the updated format string meets the rich text format requirements.
[0153] If the updated format string meets the rich text format requirements, proceed to step 1140; if the updated format string does not meet the rich text format requirements, proceed to step 1160.
[0154] Step 1140: Determine whether the text display style corresponding to the first rich text format exists in the cache.
[0155] If the text display style corresponding to the first rich text format exists in the cache, proceed to step 1141; if the text display style corresponding to the first rich text format does not exist in the cache, proceed to step 1142.
[0156] In some embodiments, if the updated format string conforms to the rich text format requirements, the text display style corresponding to the first rich text format is obtained.
[0157] Step 1141: Retrieve the text display style from the cache.
[0158] In one possible implementation, the cache pre-stores text display styles corresponding to several common rich text formats. For example, for the rich text format "..."<color=‘#FF0000’><size=‘10’> For example, the corresponding text display style is a red font color and a text size of 10.
[0159] In some embodiments, if a text display style does not exist in the cache, a text display style is created and added to the cache.
[0160] Step 1142: Create a text display style and add it to the cache.
[0161] For example, if the text display style corresponding to the first rich text format does not exist in the cache, the terminal first creates the text display style corresponding to the first rich text format and adds it to the cache.
[0162] Step 1150: Based on the text display style, render the first sub-text with text display effect in the virtual environment.
[0163] In some embodiments, the terminal displays the original text with updated effects in a virtual environment, wherein the rich text format corresponding to the first subtext in the original text with updated effects is a first rich text format.
[0164] In some embodiments, if the updated format string does not meet the rich text format requirements, step 1160 is performed.
[0165] Step 1160: Display the updated format string; or, display the error message.
[0166] The error message indicates that the first subtext contains modifier symbols that cause the updated format string to not meet the rich text format requirements.
[0167] As an example only, when the user enters the first subtext as "<subtext1=<#subtext1>", the terminal can display an error message around the subtext because the modifier symbols "<", "=" and "#" contained in the first subtext may cause confusion with the rich text format. This is to inform the user that the modifier symbols entered in the first subtext cause the updated format string to not meet the requirements of the rich text format.
[0168] In some embodiments, the content and timing of the original text display can also be controlled through a visual programming interface.
[0169] In some embodiments, the terminal displays a visual programming interface in response to a visual programming operation.
[0170] The visual programming interface is used to perform visual programming through visual program components.
[0171] Visual programming, also known as block programming, is a programming paradigm that uses graphical programming blocks to represent programs. Visual programming aims to reduce the complexity of programming, making it easy for non-professional developers to understand and create programs. Users can use visual programming applications to perform editing operations on programming blocks within the visual programming interface, such as adding, deleting, and modifying them.
[0172] A visual programming interface is an interface used for visual programming. It allows users to edit program components within a visual programming project; these components can also be referred to as programming blocks.
[0173] Optionally, visual programming operations can be trigger operations on the enabled controls of the visual programming interface.
[0174] In some embodiments, in response to a setting operation that sets the original text as a visual programming object in the visual programming interface, and an adding operation that adds a text program component, the original text in a display state is displayed in a virtual environment.
[0175] The text within each subtext of the original text, as well as the rich text formatting of the subtext, are determined based on the text program component.
[0176] The text program component can be a format string that carries the text within each subtext of the original text, as well as the rich text formatting of the subtext.
[0177] In some embodiments, in response to setting the original text as a visual programming object in the visual programming interface, adding a text program component, and setting the effective time condition of the text program component, the original text in the display state is displayed in the virtual environment if the effective time condition is met at the current time.
[0178] For example, the effective timing condition can be determined by user input, such as when the game starts or 1 second after the game begins.
[0179] See Figure 12 , Figure 12 This is a schematic diagram illustrating the editing of raw text in a wordpad through a visual programming interface, provided by an exemplary embodiment of this application.
[0180] like Figure 12 As shown, in the visual programming interface 1210, the user sets the effective time condition to "when the game starts" through program component 1221, sets the original text in the textpad as a visual programming object through program component 1222, and adds a text program component to program component 1222: "<c=#FF0000><s=35> If the example text is set to "Example Text 1", the terminal will display the original text "Example Text 1" in the textpad when the game starts, and the text display style corresponding to the original text includes a red font color and a text size of 35.
[0181] When the user sets the effective timing condition to "1 second after the game starts" through program component 1223 in the visual programming interface 1210, the user sets the original text in the writing pad as a visual programming object through program component 1224, and adds a text program component to program component 1224:<c=#FF0000><s=35> If the text is displayed as "Example Text 2", the terminal will display the original text "Example Text 2" in the textpad 1 second into the game, and the text display style corresponding to the original text will include a red font color and a text size of 35.
[0182] In this embodiment, through a visual programming interface, users can control the display content, display effect, and display timing of the original text in the writing pad through program components, thereby further enriching the usage scenarios of text editing in the virtual environment and improving the efficiency of text editing.
[0183] The text editing method in the virtual environment proposed in this application has a wide range of applications, including but not limited to the following.
[0184] (1) Writing board scene in game applications.
[0185] When a game application includes a writing pad with UGC functionality, the terminal can use the method provided in this application to edit text in the virtual environment. For example, a user can create a writing pad in the virtual environment, add different sub-texts to the same writing pad, and set corresponding text display effects for the sub-texts based on the editing controls in the sub-text editing interface.
[0186] (2) Text editing scenarios in virtual reality applications.
[0187] In virtual reality applications that include a text editing area with UGC functionality, the terminal can edit text in the virtual environment using the methods provided in the embodiments of this application. For example, users can create their own text in a virtual reality scene and set different text display effects for different sub-texts within the text.
[0188] (3) The scene of editing virtual character names in game applications.
[0189] In game applications, the virtual character name can be edited using the text editing method provided in this application within the virtual environment, thereby enabling different phrases within the virtual character name to have their own distinct text display effects. For example, a user can define the virtual character name "Red Leaves Falling" as the original text, and by selecting the subtext "Red Leaves" within the original text, display the corresponding subtext editing interface; and then perform an editing operation on the font color control in the subtext editing interface, setting the font color of the subtext "Red Leaves" to red, so that in the virtual environment, the two characters "Red Leaves" in the virtual character name will appear as red text.
[0190] It should be noted that the above application scenarios are merely examples. The text editing method in the virtual environment proposed in this application can also be applied to any other possible scenarios without limitation.
[0191] Writing pad scene in game applications
[0192] In one optional example, the text editing method in a virtual environment provided in this application embodiment is described as being applied to a writing pad scenario in a game application.
[0193] In some embodiments, the terminal displays text in an editable state on a writing pad within the virtual environment of a game application.
[0194] In some embodiments, in response to the selection of a first sub-text within the text in the writing pad, the terminal displays a sub-text editing interface corresponding to the first sub-text on the game interface, wherein the sub-text editing interface includes at least one editing control for setting the text display effect of the sub-text.
[0195] In response to editing operations performed on the editing controls in the sub-text editing interface corresponding to the first sub-text, the terminal displays the updated text in the virtual environment.
[0196] Among them, the first sub-text in the updated textpad text has the text display effect of editing operation instructions.
[0197] In one possible scenario, before a virtual character in a virtual environment performs a task, the terminal receives input into a text-based interface. This input can include task completion conditions, challenge strategies, and important notes. The terminal also receives editing options for the text display, such as highlighting, bolding, and underlining key information within the task completion prompts. By inputting these prompts and emphasizing crucial details before completing the task, users can access these hints during the task, improving efficiency.
[0198] In one possible scenario, after a virtual character completes a task in a virtual environment, the terminal receives input on the text display in the text pad. This input could include task summary information such as a leaderboard, reward details, and a completion summary. The terminal can also edit the text display for the leaderboard-ranked virtual character (e.g., increasing font size or using a specific font) or for the user's task achievements. After completing a task, by inputting a summary into the text pad and setting display effects for the leaderboard-ranked virtual character or for the task achievements, the user can review their progress, improving the efficiency of task review and summarization.
[0199] In another possible scenario, within a virtual environment where a virtual character is performing a mission, the input received by the terminal onto the text in the writing pad can be location-transfer text. Editing operations on the text display received by the terminal can add location-transfer hyperlinks to these hyperlinks. For example, a user can control a virtual character to add location-transfer hyperlinks to the writing pad during a mission. When other virtual characters in the same team click on the location-transfer text, they can be teleported to the location corresponding to that hyperlink, thus enabling teleportation to the virtual character's location via the writing pad text.
[0200] Optionally, when the terminal displays a writing pad in a virtual environment, it also displays the corresponding rich text editing interface.
[0201] The rich text editing interface is used to edit the text in the writing pad, and to edit the uniform text display effects of the writing pad text.
[0202] Optionally, in response to enabling the subtext editing control in the rich text editing interface, the terminal text editing interface displays the subtext editing entries corresponding to each subtext, and the subtext editing entries contain the subtext editing entry control.
[0203] Optionally, in response to a trigger operation on the subtext editing entry control corresponding to the first subtext in the rich text editing interface, the subtext editing interface corresponding to the first subtext is displayed.
[0204] Optionally, in response to the first enabling operation of the subtext editing enable control in the rich text editing interface, the textpad text is identified as subtext, and the subtext editing entry corresponding to the textpad text is displayed in the rich text editing interface;
[0205] Optionally, in response to a non-first-time enabling operation of the subtext editing enable control in the rich text editing interface, the text in the WordPad is divided into at least one subtext, and the subtext editing entries corresponding to each subtext are displayed in the rich text editing interface.
[0206] In addition, those skilled in the art can, according to actual needs, set other possible ways for the writing tablet text in the virtual environment and the specific use of the text display effect of the writing tablet text in the game scene, without any restrictions.
[0207] See Figure 13 , Figure 13 This is a structural block diagram of a text editing device in a virtual environment provided in an exemplary embodiment of this application. The device includes:
[0208] The original text display module 1301 is used to display original text in an editing state in a virtual environment;
[0209] The subtext editing interface display module 1302 is used to display the subtext editing interface corresponding to the first subtext in response to the selection operation of the first subtext in the original text. The subtext editing interface includes at least one editing control for setting the text display effect of the subtext.
[0210] The original text display module 1301 is further configured to respond to an editing operation on the editing control in the subtext editing interface corresponding to the first subtext, and display the updated original text in the virtual environment, wherein the first subtext in the updated original text has the text display effect indicated by the editing operation.
[0211] Optionally, the device also includes a rich text editing interface module for:
[0212] Display the rich text editing interface corresponding to the original text;
[0213] In response to the enabling operation of the sub-text editing enable control in the rich text editing interface, the sub-text editing entries corresponding to each sub-text are displayed in the rich text editing interface, and the sub-text editing entries include sub-text editing entry controls;
[0214] In response to a trigger operation on the sub-text editing entry control corresponding to the first sub-text in the rich text editing interface, the sub-text editing interface corresponding to the first sub-text is displayed.
[0215] Optional, rich text editing interface module, used for:
[0216] In response to the first enabling operation of the subtext editing enable control in the rich text editing interface, the original text is identified as subtext, and the subtext editing entry corresponding to the original text is displayed in the rich text editing interface;
[0217] In response to a non-first-time enabling operation of the subtext editing enable control in the rich text editing interface, the original text is divided into at least one subtext, and the subtext editing entries corresponding to each subtext are displayed in the rich text editing interface.
[0218] Optional, rich text editing interface module, used for:
[0219] In response to a non-first-time enabling operation of the subtext editing enable control in the rich text editing interface, the original text is divided into at least one subtext through semantic recognition of the original text; or,
[0220] In response to a non-first-time enabling operation of the subtext editing enable control in the rich text editing interface, the original text is divided into at least one subtext based on the subtext segmentation operation.
[0221] Optional, rich text editing interface module, used for:
[0222] In response to the deactivation operation of the subtext editing enable control in the rich text editing interface, the display of the subtext editing entries corresponding to each subtext in the rich text editing interface is stopped.
[0223] Optional, rich text editing interface module, used for:
[0224] In response to the enabling operation of the sub-text editing enable control in the rich text editing interface, a sub-text adding control is displayed in the rich text editing interface;
[0225] In response to the triggering operation of adding a control to the sub-text, the sub-text editing entry corresponding to the newly added sub-text is displayed;
[0226] In response to a trigger operation on the subtext editing entry control in the subtext editing entry corresponding to the newly added subtext, the newly added subtext editing interface corresponding to the newly added subtext is displayed;
[0227] Optionally, the raw text display module 1301 is used for:
[0228] In response to a text input operation in which a second subtext is entered in the newly added subtext editing interface, the original text is synchronously updated in the virtual environment, and the updated original text includes the second subtext.
[0229] Optionally, the subtext editing entry also includes a subtext deletion control; the rich text editing interface module is used for:
[0230] In response to a trigger operation on the subtext deletion control corresponding to the first subtext in the rich text editing interface, the first subtext is deleted from the original text, and the subtext editing entry corresponding to the first subtext is deleted in the rich text editing interface.
[0231] Optionally, the sub-text editing interface also includes an order adjustment control, and the sub-text editing interface display module 1302 is used for:
[0232] In response to a triggering operation of the order adjustment control in the subtext editing interface, the position of the subtext in the original text is adjusted based on the order indicated by the order adjustment control.
[0233] Optionally, when the sub-text editing interface is displayed, the sub-text corresponding to the sub-text editing interface in the original text displayed in the virtual environment has a selection mark. The sub-text editing interface also includes a sub-text switching control. The sub-text editing interface display module 1302 is used for:
[0234] In response to a trigger operation on the subtext switching control in the subtext editing interface, the subtext editing interface corresponding to the adjacent subtext in the original text is switched and displayed, and the adjacent subtext in the original text displayed in the virtual environment has the selection mark.
[0235] Optionally, the rich text editing interface also includes a text display effect reset control. The rich text editing interface module is used for:
[0236] In response to a trigger operation on the text display effect reset control, the original text after effect reset is displayed in the virtual environment, wherein each of the sub-texts in the original text after effect reset has a default text display effect.
[0237] Optionally, the original text display module 1301 is further configured to:
[0238] In response to the editing operation on the editing control in the subtext editing interface corresponding to the first subtext, a first rich text format indicated by the editing operation is determined;
[0239] Based on the first rich text format and the first subtext, the original format string corresponding to the original text is updated to obtain the updated format string;
[0240] If the updated format string meets the requirements of rich text format, the original text with the updated effect is displayed in the virtual environment, wherein the rich text format corresponding to the first subtext in the original text with the updated effect is the first rich text format.
[0241] Optionally, the original text display module 1301 is further configured to:
[0242] If the updated format string meets the rich text format requirements, obtain the text display style corresponding to the first rich text format;
[0243] Based on the text display style, the first sub-text with the text display effect is rendered in the virtual environment.
[0244] Optionally, the original text display module 1301 is further configured to:
[0245] If the text display style corresponding to the first rich text format exists in the cache, the text display style is retrieved from the cache;
[0246] If the text display style does not exist in the cache, the text display style is created and added to the cache.
[0247] Optionally, the original text display module 1301 is further configured to:
[0248] If the updated format string does not meet the rich text formatting requirements, display the updated format string; or,
[0249] If the updated format string does not meet the rich text format requirements, an error message is displayed. The error message indicates that the modifier code symbols contained in the first sub-text cause the updated format string to not meet the rich text format requirements.
[0250] Optionally, the device also includes a visual programming module for:
[0251] In response to a visual programming operation, a visual programming interface is displayed, which is used to perform visual programming through visual program components;
[0252] In response to the setting operation of setting the original text as a visual programming object in the visual programming interface, and the addition operation of the text program component, the original text in the display state is displayed in the virtual environment, wherein the text in each subtext of the original text and the rich text format of the subtext are determined based on the text program component.
[0253] Optional, visual programming module, for:
[0254] In response to the setting operation of setting the original text as a visual programming object in the visual programming interface, the addition operation of the text program component, and the setting operation of the effective time condition of the text program component, the original text in the display state is displayed in the virtual environment when the effective time condition is met at the current time.
[0255] Optionally, the original text display module 1301 is further configured to:
[0256] In response to a text copy operation on the original text, the format string corresponding to the original text is copied, the format string representing the text within each of the sub-texts in the original text and the rich text format that the sub-texts have;
[0257] In response to a text paste operation in the paste area, the original text is displayed in the paste area, wherein each of the sub-texts in the original text has a corresponding rich text format.
[0258] Optionally, the device also includes a text storage module for:
[0259] In response to a text storage operation on the original text, the original format string corresponding to the original text is converted into a shortened format string for storage, wherein the number of characters in the shortened format string is less than that in the original format string, and the original format string and the shortened format string indicate the same rich text format.
[0260] See Figure 14 , Figure 14 This is a schematic diagram of the structure of a terminal 1400 provided in an exemplary embodiment of this application.
[0261] Optionally, terminal 1400 can be a portable mobile terminal, such as a smartphone, tablet computer, laptop computer, Moving Picture Experts Group Audio Layer III (MP3) player, Moving Picture Experts Group Audio Layer IV (MP4) player, etc. The terminal can also be an in-vehicle terminal, desktop computer, smart TV, etc. The terminal may also be referred to as user equipment, portable terminal, or other names. This specification uses a smartphone as an example for illustration, but does not constitute a limitation.
[0262] Specifically, the terminal 1400 includes a Central Processing Unit (CPU) 1401, a system memory 1404 including random access memory 1402 and read-only memory 1403, and a system bus 1405 connecting the system memory 1404 and the CPU 1401. The terminal 1400 also includes a basic input / output system (I / O system) 1406 to facilitate information transfer between various devices within the computer, and a mass storage device 1407 for storing the operating system 1413, application programs 1414, and other program components 1415.
[0263] The basic input / output system 1406 includes a display 1408 for displaying information and an input device 1409 for user input, such as a mouse or keyboard. Both the display 1408 and the input device 1409 are connected to the central processing unit 1401 via an input / output controller 1410 connected to the system bus 1405. The basic input / output system 1406 may also include the input / output controller 1410 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1410 also provides output to a display screen, printer, or other types of output devices.
[0264] The mass storage device 1407 is connected to the central processing unit 1401 via a mass storage controller (not shown) connected to the system bus 1405. The mass storage device 1407 and its associated computer-readable media provide non-volatile storage for the terminal 1400. That is, the mass storage device 1407 may include computer-readable media (not shown) such as a hard disk or drive.
[0265] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program components, or other data. Computer storage media include random access memory (RAM), read-only memory (ROM), flash memory or other solid-state storage technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage media are not limited to the above-mentioned types. The system memory 1404 and mass storage device 1407 described above can be collectively referred to as memory.
[0266] The memory stores one or more programs, which are configured to be executed by one or more central processing units 1401. The one or more programs contain computer instructions for implementing the methods described above. The central processing unit 1401 executes the one or more programs to implement the methods provided in the various method embodiments described above.
[0267] According to various embodiments of this application, the terminal 1400 can also be connected to a remote computer on a network, such as the Internet. That is, the terminal 1400 can be connected to the network 1412 via the network interface unit 1411 connected to the system bus 1405, or the network interface unit 1411 can be used to connect to other types of networks or remote computer systems (not shown).
[0268] The memory further includes one or more programs stored in the memory, and the one or more programs include steps executed by the terminal in the method provided in the embodiments of this application.
[0269] This application also provides a computer-readable storage medium storing at least one computer instruction, which is loaded and executed by a processor to implement the method described in the above embodiments. Optionally, the computer-readable storage medium may include ROM, RAM, solid-state drives (SSDs), or optical discs, etc. The RAM may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM).
[0270] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A terminal's processor reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the terminal to perform the methods provided in the various optional implementations of the above aspects.
[0271] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.< / color> < / color> < / color> < / color> < / color>
Claims
1. A method for editing text in a virtual environment, characterized in that, The method includes: Display the original text in edit mode within a virtual environment; In response to the selection operation of the first sub-text in the original text, the sub-text editing interface corresponding to the first sub-text is displayed, and the sub-text editing interface includes at least one editing control for setting the text display effect of the sub-text; In response to an editing operation on the editing control in the sub-text editing interface corresponding to the first sub-text, the original text with updated effect is displayed in the virtual environment, wherein the first sub-text in the original text with updated effect has the text display effect indicated by the editing operation.
2. The method according to claim 1, characterized in that, The method further includes: Display the rich text editing interface corresponding to the original text; In response to the enabling operation of the sub-text editing enable control in the rich text editing interface, the sub-text editing entries corresponding to each sub-text are displayed in the rich text editing interface, and the sub-text editing entries include sub-text editing entry controls; The step of displaying a sub-text editing interface corresponding to the first sub-text in response to a selection operation on the original text includes: In response to a trigger operation on the sub-text editing entry control corresponding to the first sub-text in the rich text editing interface, the sub-text editing interface corresponding to the first sub-text is displayed.
3. The method according to claim 2, characterized in that, The response to enabling the sub-text editing control in the rich text editing interface, displaying the sub-text editing entries corresponding to each sub-text in the rich text editing interface, includes: In response to the first enabling operation of the subtext editing enable control in the rich text editing interface, the original text is identified as subtext, and the subtext editing entry corresponding to the original text is displayed in the rich text editing interface; In response to a non-first-time enabling operation of the subtext editing enable control in the rich text editing interface, the original text is divided into at least one subtext, and the subtext editing entries corresponding to each subtext are displayed in the rich text editing interface.
4. The method according to claim 3, characterized in that, In response to a non-first-time enabling operation of the subtext editing enable control in the rich text editing interface, the original text is divided into at least one subtext, including: In response to a non-first-time enabling operation of the subtext editing enable control in the rich text editing interface, the original text is divided into at least one subtext through semantic recognition of the original text; or, In response to a non-first-time enabling operation of the subtext editing enable control in the rich text editing interface, the original text is divided into at least one subtext based on the subtext segmentation operation.
5. The method according to any one of claims 2 to 4, characterized in that, The method further includes: In response to the deactivation operation of the subtext editing enable control in the rich text editing interface, the display of the subtext editing entries corresponding to each subtext in the rich text editing interface is stopped.
6. The method according to any one of claims 2 to 5, characterized in that, The method further includes: In response to the enabling operation of the sub-text editing enable control in the rich text editing interface, a sub-text adding control is displayed in the rich text editing interface; In response to the triggering operation of adding a control to the sub-text, the sub-text editing entry corresponding to the newly added sub-text is displayed; In response to a trigger operation on the subtext editing entry control in the subtext editing entry corresponding to the newly added subtext, the newly added subtext editing interface corresponding to the newly added subtext is displayed; In response to a text input operation in which a second subtext is entered in the newly added subtext editing interface, the original text is synchronously updated in the virtual environment, and the updated original text includes the second subtext.
7. The method according to any one of claims 2 to 6, characterized in that, The sub-text editing entry also includes a sub-text deletion control, and the method further includes: In response to a trigger operation on the subtext deletion control corresponding to the first subtext in the rich text editing interface, the first subtext is deleted from the original text, and the subtext editing entry corresponding to the first subtext is deleted in the rich text editing interface.
8. The method according to any one of claims 2 to 7, characterized in that, The sub-text editing interface also includes an order adjustment control, and the method further includes: In response to a triggering operation of the order adjustment control in the subtext editing interface, the position of the subtext in the original text is adjusted based on the order indicated by the order adjustment control.
9. The method according to any one of claims 2 to 8, characterized in that, When the subtext editing interface is displayed, the subtext corresponding to the subtext editing interface in the original text displayed in the virtual environment has a selection indicator. The subtext editing interface also includes a subtext switching control. The method further includes: In response to a trigger operation on the subtext switching control in the subtext editing interface, the subtext editing interface corresponding to the adjacent subtext of the subtext in the original text is switched and displayed, and the adjacent subtext in the original text displayed in the virtual environment has the selection mark.
10. The method according to any one of claims 2 to 9, characterized in that, The rich text editing interface also includes a text display effect reset control, and the method further includes: In response to a trigger operation on the text display effect reset control, the original text after effect reset is displayed in the virtual environment, wherein each of the sub-texts in the original text after effect reset has a default text display effect.
11. The method according to any one of claims 1 to 10, characterized in that, The step of responding to an editing operation on the editing control in the sub-text editing interface corresponding to the first sub-text, and displaying the updated original text in the virtual environment, includes: In response to the editing operation on the editing control in the subtext editing interface corresponding to the first subtext, a first rich text format indicated by the editing operation is determined; Based on the first rich text format and the first subtext, the original format string corresponding to the original text is updated to obtain the updated format string; If the updated format string meets the requirements of rich text format, the original text with the updated effect is displayed in the virtual environment, wherein the rich text format corresponding to the first subtext in the original text with the updated effect is the first rich text format.
12. The method according to claim 11, characterized in that, The step of displaying the updated original text in the virtual environment when the updated format string conforms to the rich text format requirements includes: If the updated format string meets the rich text format requirements, obtain the text display style corresponding to the first rich text format; Based on the text display style, the first sub-text with the text display effect is rendered in the virtual environment.
13. The method according to claim 12, characterized in that, The step of obtaining the text display style corresponding to the first rich text format includes: If the text display style corresponding to the first rich text format exists in the cache, the text display style is retrieved from the cache; If the text display style does not exist in the cache, the text display style is created and added to the cache.
14. The method according to claim 11, characterized in that, The method further includes: If the updated format string does not meet the rich text formatting requirements, display the updated format string; or, If the updated format string does not meet the rich text format requirements, an error message is displayed. The error message indicates that the modifier code symbols contained in the first sub-text cause the updated format string to not meet the rich text format requirements.
15. The method according to any one of claims 1 to 14, characterized in that, The method further includes: In response to a visual programming operation, a visual programming interface is displayed, which is used to perform visual programming through visual program components; In response to the setting operation of setting the original text as a visual programming object in the visual programming interface, and the addition operation of the text program component, the original text in the display state is displayed in the virtual environment, wherein the text in each subtext of the original text and the rich text format of the subtext are determined based on the text program component.
16. The method according to claim 15, characterized in that, The response to the setting operation of setting the original text as a visual programming object in the visual programming interface, and the adding operation of the text program component, to display the original text in the display state in the virtual environment includes: In response to the setting operation of setting the original text as a visual programming object in the visual programming interface, the addition operation of the text program component, and the setting operation of the effective time condition of the text program component, the original text in the display state is displayed in the virtual environment when the effective time condition is met at the current time.
17. The method according to any one of claims 1 to 16, characterized in that, The method further includes: In response to a text copy operation on the original text, the format string corresponding to the original text is copied, the format string representing the text within each of the sub-texts in the original text and the rich text format that the sub-texts have; In response to a text paste operation in the paste area, the original text is displayed in the paste area, wherein each of the sub-texts in the original text has a corresponding rich text format.
18. The method according to any one of claims 1 to 17, characterized in that, The method further includes: In response to a text storage operation on the original text, the original format string corresponding to the original text is converted into a shortened format string for storage, wherein the number of characters in the shortened format string is less than that in the original format string, and the original format string and the shortened format string indicate the same rich text format.
19. A text editing device in a virtual environment, characterized in that, The device includes: The raw text display module is used to display raw text that is in editing mode in a virtual environment; The subtext editing interface display module is used to display the subtext editing interface corresponding to the first subtext in response to the selection operation of the first subtext in the original text. The subtext editing interface includes at least one editing control for setting the text display effect of the subtext. The original text display module is further configured to respond to an editing operation of the editing control in the sub-text editing interface corresponding to the first sub-text, and display the updated original text in the virtual environment, wherein the first sub-text in the updated original text has the text display effect indicated by the editing operation.
20. A terminal, characterized in that, The terminal includes a processor and a memory; the memory stores at least one computer instruction, which is executed by the processor to implement the text editing method in a virtual environment as described in any one of claims 1 to 18.
21. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer instruction, which is loaded and executed by a processor to implement the text editing method in a virtual environment as described in any one of claims 1 to 18.
22. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium; the processor of the terminal reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the terminal to perform a text editing method in a virtual environment as described in any one of claims 1 to 18.